Index: openacs-4/packages/lorsm/lorsm.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/lorsm.info,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/lorsm/lorsm.info	4 Sep 2004 14:51:18 -0000	1.2
+++ openacs-4/packages/lorsm/lorsm.info	14 Nov 2004 12:50:09 -0000	1.3
@@ -8,14 +8,14 @@
     <singleton-p>f</singleton-p>
     <auto-mount>lorsm</auto-mount>
 
-    <version name="0.4d" url="http://openacs.org/repository/download/apm/lorsm-0.4d.apm">
+    <version name="0.5d" url="http://openacs.org/repository/download/apm/lorsm-0.5d.apm">
         <owner url="mailto:ernieg@mm.st">Ernie Ghiglione</owner>
         <summary>Application to manage the services from the Learning Object Repository. </summary>
         <release-date>2004-06-19</release-date>
         <description format="text/html">This application manages the services from the Learning Object Repository: upload courses, manage and create metadata, delete resources and courses. </description>
 
-        <provides url="lorsm" version="0.4d"/>
-        <requires url="lors" version="0.4d"/>
+        <provides url="lorsm" version="0.5d"/>
+        <requires url="lors" version="0.5d"/>
         <requires url="views" version="0.1d"/>
 
         <callbacks>
Index: openacs-4/packages/lorsm/www/course-structure.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/course-structure.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/lorsm/www/course-structure.tcl	4 Sep 2004 14:51:21 -0000	1.2
+++ openacs-4/packages/lorsm/www/course-structure.tcl	14 Nov 2004 12:50:09 -0000	1.3
@@ -148,7 +148,7 @@
     set table_def {
 	{ title "Item Name" "no_sort" "<td>$indent[if {![empty_string_p $identifierref]} {set href \"<a href='[apm_package_url_from_id $fs_package_id]view/[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/[lorsm::fix_url -url $identifierref]'>$item_title</a>\"} else {set href $item_title}]</td>" }
 	{ Edit "Edit?" "no_sort" "<td align=\"center\">[if {![empty_string_p $identifierref]} {set href \"<a href=\'[export_vars -base edit-content {identifierref folder_id return_url fs_package_id}]\'>Edit</a></td>\"}]"}
-	{ metadata "Metadata?" "no_sort" "<td align=\"center\">[if {$hasmetadata == \"f\"} {set hasmetadata \"No\"} else {set hasmetadata \"<a href=md/?ims_md_id=$item_id>Metadata\"}]</a></td>" }
+	{ metadata "Metadata?" "no_sort" "<td align=\"center\">[if {$hasmetadata == \"f\"} {set hasmetadata \"<a href=md?ims_md_id=$item_id>No\"} else {set hasmetadata \"<a href=md/?ims_md_id=$item_id>Yes\"}]</a></td>" }
 	{ type   "Type" "no_sort" "<td align=\"center\">$type</td>" }
 	{ shared "Is Shared?" "no_sort" "<td align=\"center\">[if {$isshared == false} {set ret \"No\"}]</td>" }
     }
Index: openacs-4/packages/lorsm/www/lib/md-record.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/lib/Attic/md-record.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lorsm/www/lib/md-record.tcl	22 Apr 2004 03:58:12 -0000	1.1
+++ openacs-4/packages/lorsm/www/lib/md-record.tcl	14 Nov 2004 12:50:10 -0000	1.2
@@ -7,7 +7,7 @@
 lappend actions  "Educational MD" [export_vars -base educationalmd {ims_md_id}] "View Educational Metadata"
 lappend actions  "Rights MD" [export_vars -base rightsmd {ims_md_id}] "View Rights Metadata"
 lappend actions  "Relation MD" [export_vars -base relationmd {ims_md_id}] "View Relation Metadata"
-lappend actions  "Annotation MD" [export_vars -base generalmd {ims_md_id}] "View Annotation Metadata"
+lappend actions  "Annotation MD" [export_vars -base annotationmd {ims_md_id}] "View Annotation Metadata"
 lappend actions  "Classification MD" [export_vars -base classificationmd {ims_md_id}] "View Classification Metadata"
 
 
@@ -21,13 +21,41 @@
         object_type {
             label "Object Type"
         }
+	schema_and_version {
+	    label "MD Schema and Version"
+            html { align center }
+	}
+        admin {
+            label "Edit Schema Details"
+            display_eval {Modify Schema}
+            link_url_eval {[export_vars -base "addmd" ims_md_id]}
+            link_html {title "Admin Course" class button}
+            html { align center }
+        }
+
     }
 
 db_multirow d_pres select_ge_titles {
-    select 
+    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/lorsm/www/md/addmd.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/addmd.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/addmd.adp	14 Nov 2004 12:50:10 -0000	1.1
@@ -0,0 +1,31 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<h3>MD Schema</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th>Metadata Schema</th>
+    </tr>
+    <tr class="form-section">
+      <td><listtemplate name= "md_schema_info"></listtemplate></td>
+    </tr>
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add Metadata Schema</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr>
+      <td>Object: <b><i>@object_type@</i></b><br>
+          <small>Add details for the metadata schema and version.</small>
+      </td>
+    </tr>   
+    <tr>
+      <formtemplate id="add_md" style="standard-lars"></formtemplate>
+    </tr>
+  </table>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/addmd.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/addmd.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/addmd.tcl	14 Nov 2004 12:50:10 -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 2004/11/14 12:50:10 ernieg 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]  "IMS Metadata Editor"] "Edit Metadata Schema and Schema Version"]
+set title "Add/Edit MD Schema and Version"
+
+
+# Form
+ad_form -name add_md \
+    -cancel_url ".." \
+    -mode edit \
+    -form {
+
+    {schema:text,nospell
+        {html {size 20}}
+	{help_text "Metadata schema. i.e.: 'IMS Content'"}
+        {label "Schema:"}
+    }
+
+    {schemaversion:text,nospell
+        {html {size 10}}
+	{help_text "Version of the Schema. i.e.: '1.2.1'"}
+        {label "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 "No Schema Available" \
+	-html { align right style "width: 100%;" } \
+	-elements {
+	    schema {
+            label "Schema"
+	    html { align center }
+	    }
+	    schemaversion {
+            label "Version"
+	    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/lorsm/www/md/annotationmd.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/annotationmd.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/annotationmd.adp	14 Nov 2004 12:50:11 -0000	1.1
@@ -0,0 +1,16 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../lib/md-record"
+    ims_md_id="@ims_md_id;noquote@"/>
+
+  <table cellspacing="2" cellpadding="2" border="0">
+    <tr class="form-section">
+      <th colspan="2">Annotation Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Annotations: </td>
+      <td><listtemplate name= "d_an_annot"></listtemplate></td>
+    </tr>   
+  </table>
Index: openacs-4/packages/lorsm/www/md/annotationmd.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/annotationmd.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/annotationmd.tcl	14 Nov 2004 12:50:11 -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 2004/11/14 12:50:11 ernieg Exp $
+
+} {
+    ims_md_id:integer
+}
+
+# set context & title
+set context [list [list [export_vars -base "." ims_md_id] "IMS Metadata Editor"]  "Annotation MD"]
+set title "Annotation MD"
+
+# Annotation
+template::list::create \
+    -name d_an_annot \
+    -multirow d_an_annot \
+    -no_data "No Annotation Available" \
+    -actions [list "Add Annotation" [export_vars -base annotationmd/annotation_add {ims_md_id}] "Add another Annotation MD Entry"] \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        entity {
+            label "Entry"
+        }
+	export {
+            display_eval {\[View\]}
+            link_url_eval { [export_vars -base "annotationmd/annotation" {ims_md_an_id ims_md_id}] }
+            link_html {title "View associated Annotation MD"}
+            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/lorsm/www/md/classificationmd.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/classificationmd.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd.adp	14 Nov 2004 12:50:11 -0000	1.1
@@ -0,0 +1,16 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../lib/md-record"
+    ims_md_id="@ims_md_id;noquote@"/>
+
+  <table cellspacing="2" cellpadding="2" border="0">
+    <tr class="form-section">
+      <th colspan="2">Classification Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Classifications: </td>
+      <td><listtemplate name= "d_cl_class"></listtemplate></td>
+    </tr>   
+  </table>
Index: openacs-4/packages/lorsm/www/md/classificationmd.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/classificationmd.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd.tcl	14 Nov 2004 12:50:11 -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 2004/11/14 12:50:11 ernieg Exp $
+
+} {
+    ims_md_id:integer
+}
+
+# set context & title
+set context [list [list [export_vars -base "." ims_md_id] "IMS Metadata Editor"]  "Classification MD"]
+set title "Classification MD"
+
+# Classification
+template::list::create \
+    -name d_cl_class \
+    -multirow d_cl_class \
+    -no_data "No Classification Available" \
+    -actions [list "Add Classification" [export_vars -base classificationmd/classification_add {ims_md_id}] "Add another Classification MD Entry"] \
+    -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 "View associated Classification MD"}
+            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/lorsm/www/md/educationalmd.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/educationalmd.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lorsm/www/md/educationalmd.tcl	22 Apr 2004 03:58:12 -0000	1.1
+++ openacs-4/packages/lorsm/www/md/educationalmd.tcl	14 Nov 2004 12:50:11 -0000	1.2
@@ -10,15 +10,15 @@
 }
 
 # set context & title
-set context [list "IMS Metadata Editor - Educational MD"]
+set context [list [list [export_vars -base "." ims_md_id] "IMS Metadata Editor"]  "Educational MD"]
 set title "Educational MD"
 
 # Educational Interactivity Type
 template::list::create \
     -name d_ed_intt \
     -multirow d_ed_intt \
     -no_data "No Interactivity Type Available" \
-    -actions [list "Add Interactivity Type" [export_vars -base educationalmd_intt {ims_md_id}] "Add another Interactivity Type"] \
+    -actions [list "Add Interactivity Type" [export_vars -base educationalmd/educational_intt {ims_md_id}] "Add another Interactivity Type"] \
     -html { align right style "width: 100%;" } \
     -elements {
         intt {
@@ -40,7 +40,7 @@
     -name d_ed_lrt \
     -multirow d_ed_lrt \
     -no_data "No Learning Resource Type Available" \
-    -actions [list "Add Learning Resource Type" [export_vars -base educationalmd_lrt {ims_md_id}] "Add another Learning Resource Type"] \
+    -actions [list "Add Learning Resource Type" [export_vars -base educationalmd/educational_lrt {ims_md_id}] "Add another Learning Resource Type"] \
     -html { align right style "width: 100%;" } \
     -elements {
         lrt {
@@ -62,7 +62,7 @@
     -name d_ed_intl \
     -multirow d_ed_intl \
     -no_data "No Interactivity Level Available" \
-    -actions [list "Add Interactivity Level" [export_vars -base educationalmd_intl {ims_md_id}] "Add another Interactivity Level"] \
+    -actions [list "Add Interactivity Level" [export_vars -base educationalmd/educational_intl {ims_md_id}] "Add another Interactivity Level"] \
     -html { align right style "width: 100%;" } \
     -elements {
         intl {
@@ -84,7 +84,7 @@
     -name d_ed_semd \
     -multirow d_ed_semd \
     -no_data "No Semantic Density Available" \
-    -actions [list "Add Semantic Density" [export_vars -base educationalmd_semd {ims_md_id}] "Add another Semantic Density"] \
+    -actions [list "Add Semantic Density" [export_vars -base educationalmd/educational_semd {ims_md_id}] "Add another Semantic Density"] \
     -html { align right style "width: 100%;" } \
     -elements {
         semd {
@@ -106,7 +106,7 @@
     -name d_ed_ieur \
     -multirow d_ed_ieur \
     -no_data "No Intended End User Role Available" \
-    -actions [list "Add Intended End User Role" [export_vars -base educationalmd_ieur {ims_md_id}] "Add another Intended End User Role"] \
+    -actions [list "Add Intended End User Role" [export_vars -base educationalmd/educational_ieur {ims_md_id}] "Add another Intended End User Role"] \
     -html { align right style "width: 100%;" } \
     -elements {
         ieur {
@@ -128,7 +128,7 @@
     -name d_ed_cont \
     -multirow d_ed_cont \
     -no_data "No Context Available" \
-    -actions [list "Add Context" [export_vars -base educationalmd_cont {ims_md_id}] "Add another Context"] \
+    -actions [list "Add Context" [export_vars -base educationalmd/educational_cont {ims_md_id}] "Add another Context"] \
     -html { align right style "width: 100%;" } \
     -elements {
         context {
@@ -150,7 +150,7 @@
     -name d_ed_tar \
     -multirow d_ed_tar \
     -no_data "No Typical Age Range Available" \
-    -actions [list "Add Typical Age Range" [export_vars -base educationalmd_tar {ims_md_id}] "Add another Typical Age Range"] \
+    -actions [list "Add Typical Age Range" [export_vars -base educationalmd/educational_tar {ims_md_id}] "Add another Typical Age Range"] \
     -html { align right style "width: 100%;" } \
     -elements {
         tar {
@@ -172,7 +172,7 @@
     -name d_ed_dif \
     -multirow d_ed_dif \
     -no_data "No Difficulty Available" \
-    -actions [list "Add Difficulty Type" [export_vars -base educationalmd_dif {ims_md_id}] "Add another Difficulty"] \
+    -actions [list "Add Difficulty Type" [export_vars -base educationalmd/educational_dif {ims_md_id}] "Add another Difficulty"] \
     -html { align right style "width: 100%;" } \
     -elements {
         diff {
@@ -194,7 +194,7 @@
     -name d_ed_tlt \
     -multirow d_ed_tlt \
     -no_data "No Typical Learning Time Available" \
-    -actions [list "Add Typical Learning Time" [export_vars -base educationalmd_tlt {ims_md_id}] "Add another Typical Learning Time"] \
+    -actions [list "Add Typical Learning Time" [export_vars -base educationalmd/educational_tlt {ims_md_id}] "Add another Typical Learning Time"] \
     -html { align right style "width: 100%;" } \
     -elements {
         tlt {
@@ -220,7 +220,7 @@
     -name d_ed_desc \
     -multirow d_ed_desc \
     -no_data "No Description Available" \
-    -actions [list "Add Description" [export_vars -base educationalmd_tlt {ims_md_id}] "Add another Description"] \
+    -actions [list "Add Description" [export_vars -base educationalmd/educational_desc {ims_md_id}] "Add another Description"] \
     -html { align right style "width: 100%;" } \
     -elements {
         desc {
@@ -242,7 +242,7 @@
     -name d_ed_lang \
     -multirow d_ed_lang \
     -no_data "No Language Available" \
-    -actions [list "Add Language" [export_vars -base educationalmd_lang {ims_md_id}] "Add another Language"] \
+    -actions [list "Add Language" [export_vars -base educationalmd/educational_lang {ims_md_id}] "Add another Language"] \
     -html { align right style "width: 100%;" } \
     -elements {
         language {
@@ -257,4 +257,4 @@
            ims_md_educational_lang
     where
            ims_md_id = :ims_md_id
-} 
\ No newline at end of file
+} 
Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/www/md/general_title.adp'.
Fisheye: No comparison available.  Pass `N' to diff?
Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/www/md/general_title.tcl'.
Fisheye: No comparison available.  Pass `N' to diff?
Index: openacs-4/packages/lorsm/www/md/generalmd.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/generalmd.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lorsm/www/md/generalmd.adp	22 Apr 2004 03:58:12 -0000	1.1
+++ openacs-4/packages/lorsm/www/md/generalmd.adp	14 Nov 2004 12:50:11 -0000	1.2
@@ -3,11 +3,8 @@
 <property name="context">@context;noquote@</property>
 
 <include src="../lib/md-record"
-    ims_md_id="@ims_md_id;noquote@"
-/>
+    ims_md_id="@ims_md_id;noquote@"/>
 
-<hr>
-
   <table cellspacing="2" cellpadding="2" border="0">
     <tr class="form-section">
       <th colspan="2">General Metadata</th>
@@ -18,7 +15,7 @@
     </tr>   
 
     <tr class="form-section">
-     <td class="form-section">Catalog entries: </td>
+     <td class="form-section">Catalog-Entries: </td>
      <td><listtemplate name= "d_gen_cata"></listtemplate></td>
     </tr>
 
@@ -48,7 +45,7 @@
     </tr>
 
     <tr class="form-section">
-        <td class="form-section">Aggregation Levels: </td>
+        <td class="form-section">Aggregation Level: </td>
         <td><listtemplate name= "d_gen_aggl"></listtemplate></td>
     </tr>
 
Index: openacs-4/packages/lorsm/www/md/generalmd.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/generalmd.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lorsm/www/md/generalmd.tcl	22 Apr 2004 03:58:13 -0000	1.1
+++ openacs-4/packages/lorsm/www/md/generalmd.tcl	14 Nov 2004 12:50:11 -0000	1.2
@@ -1,3 +1,5 @@
+# packages/lorsm/www/md/generalmd.tcl
+
 ad_page_contract {
     Displays/Adds IMS Metadata General
 
@@ -10,15 +12,15 @@
 }
 
 # set context & title
-set context [list "IMS Metadata Editor - General MD"]
+set context [list [list [export_vars -base "." ims_md_id] "IMS Metadata Editor"]  "General MD"]
 set title "General MD"
 
 # General Title
 template::list::create \
     -name d_gen_titles \
     -multirow d_gen_titles \
     -no_data "No Titles Available" \
-    -actions [list "Add title" [export_vars -base general_title {ims_md_id}] "Add another title"] \
+    -actions [list "Add Title" [export_vars -base generalmd/general_title {ims_md_id}] "Add another title"] \
     -html { align right style "width: 100%;" } \
     -elements {
         title_l {
@@ -45,7 +47,7 @@
     -name d_gen_desc \
     -multirow d_gen_desc \
     -no_data "No Description Available" \
-    -actions [list "Add Description" [export_vars -base general_desc {ims_md_id}] "Add another Description"] \
+    -actions [list "Add Description" [export_vars -base generalmd/general_desc {ims_md_id}] "Add another Description"] \
     -html { align right style "width: 100%;" } \
     -elements {
         descrip_l {
@@ -70,7 +72,7 @@
     -name d_gen_cata \
     -multirow d_gen_cata \
     -no_data "No Catalog Entry Available" \
-    -actions [list "Add Catalog-Entry" [export_vars -base general_cata {ims_md_id}] "Add another Catalog-Entry"] \
+    -actions [list "Add Catalog-Entry" [export_vars -base generalmd/general_cata {ims_md_id}] "Add another Catalog-Entry"] \
     -html { align right style "width: 100%;" } \
     -elements {
         catalog {
@@ -102,7 +104,7 @@
     -name d_gen_lang \
     -multirow d_gen_lang \
     -no_data "No Language Available" \
-    -actions [list "Add Language"  [export_vars -base general_lang {ims_md_id}] "Add another Language"] \
+    -actions [list "Add Language"  [export_vars -base generalmd/general_lang {ims_md_id}] "Add another Language"] \
     -html { align right style "width: 100%;" } \
     -elements {
         language {
@@ -124,7 +126,7 @@
     -name d_gen_key \
     -multirow d_gen_key \
     -no_data "No Keywords Available" \
-    -actions [list "Add Keywords" [export_vars -base general_key {ims_md_id}] "Add another Keywords"] \
+    -actions [list "Add Keywords" [export_vars -base generalmd/general_key {ims_md_id}] "Add another Keywords"] \
     -html { align right style "width: 100%;" } \
     -elements {
         keyword_l {
@@ -150,7 +152,7 @@
     -name d_gen_cover \
     -multirow d_gen_cover \
     -no_data "No Coverage Available" \
-    -actions [list "Add Coverage" [export_vars -base general_cover {ims_md_id}] "Add another Coverage"] \
+    -actions [list "Add Coverage" [export_vars -base generalmd/general_cover {ims_md_id}] "Add another Coverage"] \
     -html { align right style "width: 100%;" } \
     -elements {
         cover_l {
@@ -176,7 +178,7 @@
     -name d_gen_struc \
     -multirow d_gen_struc \
     -no_data "No Structure Available" \
-    -actions [list "Add Structure" [export_vars -base general_struc {ims_md_id}] "Add another Structure"] \
+    -actions [list "Add Structure" [export_vars -base generalmd/general_struc {ims_md_id}] "Add another Structure"] \
     -html { align right style "width: 100%;" } \
     -elements {
         structure_s {
@@ -203,7 +205,7 @@
     -name d_gen_aggl \
     -multirow d_gen_aggl \
     -no_data "No Aggregation Level  Available" \
-    -actions [list "Add Aggregation Level" [export_vars -base general_aggl {ims_md_id}]  "Add another Aggregation Level"] \
+    -actions [list "Add Aggregation Level" [export_vars -base generalmd/general_aggl {ims_md_id}]  "Add another Aggregation Level"] \
     -html { align right style "width: 100%;" } \
     -elements {
         agg_level_s {
@@ -222,4 +224,4 @@
            ims_md_general
     where
            ims_md_id = :ims_md_id
-}
\ No newline at end of file
+}
Index: openacs-4/packages/lorsm/www/md/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/index.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/lorsm/www/md/index.adp	4 Sep 2004 14:51:29 -0000	1.2
+++ openacs-4/packages/lorsm/www/md/index.adp	14 Nov 2004 12:50:11 -0000	1.3
@@ -2,9 +2,11 @@
 <property name="title">@title;noquote@</property>
 <property name="context">@context;noquote@</property>
 
+<if @hasmetadata@ >
 <include src="../lib/md-record"
     ims_md_id="@ims_md_id;noquote@"/>
 
+
 <p>
 <if @write_p@ eq 1>
  You can <a href="@link@">upload a XML LOM metadata node</a> to add/change the metadata for this record.
@@ -13,4 +15,12 @@
 <if @read_p@ eq 1>
  Here's a link to the actual element
 </if>
+</if>
 
+<else>
+<p>
+No metadata record exist for this object: @object_type@. 
+<if @write_p@ eq 1>
+<ul><li><a href=addmd?ims_md_id=@ims_md_id;noquote@>Add metadata</a></li></ul>
+</if>
+</else>
Index: openacs-4/packages/lorsm/www/md/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/index.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/lorsm/www/md/index.tcl	4 Sep 2004 14:51:29 -0000	1.2
+++ openacs-4/packages/lorsm/www/md/index.tcl	14 Nov 2004 12:50:11 -0000	1.3
@@ -14,6 +14,8 @@
 set title "IMS Metadata Editor"
 set link [export_vars -base "md_upload" ims_md_id]
 
-set write_p [permission::permission_p -party_id [ad_conn user_id] -object_id $ims_md_id -privilege write]
+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/lorsm/www/md/lifecyclemd.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/lifecyclemd.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lorsm/www/md/lifecyclemd.adp	22 Apr 2004 03:58:13 -0000	1.1
+++ openacs-4/packages/lorsm/www/md/lifecyclemd.adp	14 Nov 2004 12:50:11 -0000	1.2
@@ -20,7 +20,7 @@
     </tr>   
 
     <tr class="form-section">
-      <td class="form-section">Contributes: </td>
+      <td class="form-section">Contribution: </td>
       <td><listtemplate name= "d_lf_cont"></listtemplate></td>
     </tr>   
 
Index: openacs-4/packages/lorsm/www/md/lifecyclemd.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/lifecyclemd.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lorsm/www/md/lifecyclemd.tcl	22 Apr 2004 03:58:13 -0000	1.1
+++ openacs-4/packages/lorsm/www/md/lifecyclemd.tcl	14 Nov 2004 12:50:11 -0000	1.2
@@ -10,15 +10,16 @@
 }
 
 # set context & title
-set context [list "IMS Metadata Editor - Lifecycle MD"]
+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 "No Version Available" \
-    -actions [list "Add Version" [export_vars -base lifecycle_version {ims_md_id}] "Add Version"] \
+    -actions [list "Add Version" [export_vars -base lifecyclemd/lifecycle_version {ims_md_id}] "Add Version"] \
     -html { align right style "width: 100%;" } \
     -elements {
         version_l {
@@ -42,8 +43,8 @@
 template::list::create \
     -name d_lf_stat \
     -multirow d_lf_stat \
-    -no_data "No Version Available" \
-    -actions [list "Add Status" [export_vars -base lifecycle_stat {ims_md_id}] "Add Status"] \
+    -no_data "No Status Available" \
+    -actions [list "Add Status" [export_vars -base lifecyclemd/lifecycle_stat {ims_md_id}] "Add Status"] \
     -html { align right style "width: 100%;" } \
     -elements {
         status_s {
@@ -69,7 +70,7 @@
     -name d_lf_cont \
     -multirow d_lf_cont \
     -no_data "No Contributors Available" \
-    -actions [list "Add Contributors" [export_vars -base lifecycle_cont {ims_md_id}] "Add another Contributors"] \
+    -actions [list "Add Contributors" [export_vars -base lifecyclemd/lifecycle_cont {ims_md_id}] "Add another Contributors"] \
     -html { align right style "width: 100%;" } \
     -elements {
         role {
Index: openacs-4/packages/lorsm/www/md/metamd.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/metamd.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lorsm/www/md/metamd.adp	22 Apr 2004 03:58:13 -0000	1.1
+++ openacs-4/packages/lorsm/www/md/metamd.adp	14 Nov 2004 12:50:11 -0000	1.2
@@ -10,12 +10,12 @@
       <th colspan="2">Meta Metadata</th>
     </tr>
     <tr class="form-section">
-      <td class="form-section">Catalog: </td>
+      <td class="form-section">Catalog-Entries: </td>
       <td><listtemplate name= "d_md_cata"></listtemplate></td>
     </tr>   
 
     <tr class="form-section">
-      <td class="form-section">Contributes: </td>
+      <td class="form-section">Contribution: </td>
       <td><listtemplate name= "d_md_cont"></listtemplate></td>
     </tr>   
 
Index: openacs-4/packages/lorsm/www/md/metamd.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/metamd.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lorsm/www/md/metamd.tcl	22 Apr 2004 03:58:13 -0000	1.1
+++ openacs-4/packages/lorsm/www/md/metamd.tcl	14 Nov 2004 12:50:11 -0000	1.2
@@ -10,22 +10,22 @@
 }
 
 # set context & title
-set context [list "IMS Metadata Editor - Metadata MD"]
-set title "Metadata MD"
+set context [list [list [export_vars -base "." ims_md_id] "IMS Metadata Editor"]  "Meta Metadata"]
+set title "Meta MD"
 
 # Metametadata Catalogentry
 template::list::create \
     -name d_md_cata \
     -multirow d_md_cata \
     -no_data "No Catalog Entry Available" \
-    -actions [list "Add Catalog-Entry" [export_vars -base metamd_cata {ims_md_id}] "Add another Catalog-Entry"] \
+    -actions [list "Add Catalog-Entry" [export_vars -base metamd/meta_cata {ims_md_id}] "Add another Catalog-Entry"] \
     -html { align right style "width: 100%;" } \
     -elements {
         catalog {
             label "Catalog"
         }
         entry_ls {
-            label "\Language\ Entry"
+            label "Language Entry"
         }
     }
 
@@ -45,7 +45,7 @@
     -name d_md_cont \
     -multirow d_md_cont \
     -no_data "No Contributors Available" \
-    -actions [list "Add Contributors" [export_vars -base metamd_cont {ims_md_id}] "Add another Contributors"] \
+    -actions [list "Add Contributors" [export_vars -base metamd/meta_cont {ims_md_id}] "Add another Contributors"] \
     -html { align right style "width: 100%;" } \
     -elements {
         role {
@@ -64,7 +64,7 @@
 
 db_multirow d_md_cont select_md_cont {
 select 
-	mdc.role_v || ' ' || '[' || mdc.role_s || ']' as role,
+    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
@@ -82,7 +82,7 @@
     -name d_md_scheme \
     -multirow d_md_scheme \
     -no_data "No Scheme Available" \
-    -actions [list "Add Scheme" [export_vars -base metamd_scheme {ims_md_id}] "Add another Scheme"] \
+    -actions [list "Add Scheme" [export_vars -base metamd/meta_scheme {ims_md_id}] "Add another Scheme"] \
     -html { align right style "width: 100%;" } \
     -elements {
         scheme {
@@ -104,7 +104,7 @@
     -name d_md_lang \
     -multirow d_md_lang \
     -no_data "No Language Available" \
-    -actions [list "Add Language" [export_vars -base metamd_lang {ims_md_id}] "Add another Languages"] \
+    -actions [list "Add Language" [export_vars -base metamd/meta_lang {ims_md_id}] "Add another Languages"] \
     -html { align right style "width: 100%;" } \
     -elements {
         language {
@@ -119,4 +119,4 @@
            ims_md_metadata
     where
            ims_md_id = :ims_md_id
-} 
\ No newline at end of file
+} 
Index: openacs-4/packages/lorsm/www/md/relationmd.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/relationmd.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lorsm/www/md/relationmd.adp	22 Apr 2004 03:58:13 -0000	1.1
+++ openacs-4/packages/lorsm/www/md/relationmd.adp	14 Nov 2004 12:50:11 -0000	1.2
@@ -1,4 +1,6 @@
 <master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
 
 <include src="../lib/md-record"
     ims_md_id="@ims_md_id;noquote@"/>
@@ -7,11 +9,8 @@
     <tr class="form-section">
       <th colspan="2">Relation Metadata</th>
     </tr>
-
     <tr class="form-section">
-      <td class="form-section">Cost: </td>
-      <td><listtemplate name= "d_ri_cost"></listtemplate></td>
+      <td class="form-section">Relations: </td>
+      <td><listtemplate name= "d_re_relat"></listtemplate></td>
     </tr>   
-
-
-  </table>
\ No newline at end of file
+  </table>
Index: openacs-4/packages/lorsm/www/md/relationmd.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/relationmd.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lorsm/www/md/relationmd.tcl	22 Apr 2004 03:58:13 -0000	1.1
+++ openacs-4/packages/lorsm/www/md/relationmd.tcl	14 Nov 2004 12:50:11 -0000	1.2
@@ -1,33 +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 30 January 2004
+    @creation-date 16 October 2004
     @cvs-id $Id$
 
 } {
     ims_md_id:integer
 }
 
+# set context & title
+set context [list [list [export_vars -base "." ims_md_id] "IMS Metadata Editor"]  "Relation MD"]
+set title "Relation MD"
 
-# Rights Cost
+# Relation
 template::list::create \
-    -name d_re_kind \
-    -multirow d_ri_cost \
-    -no_data "No Cost Available" \
-    -actions [list "Add Cost" [export_vars -base educationalmd_cost {ims_md_id}] "Add another Cost"] \
+    -name d_re_relat \
+    -multirow d_re_relat \
+    -no_data "No Relation Available" \
+    -actions [list "Add Relation" [export_vars -base relationmd/relation_add {ims_md_id}] "Add another Relation MD Entry"] \
     -html { align right style "width: 100%;" } \
     -elements {
-        cost {
+        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 "View associated Relation MD"}
+            html { align center }
+        }
     }
 
-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
+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/lorsm/www/md/rightsmd.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/rightsmd.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lorsm/www/md/rightsmd.tcl	22 Apr 2004 03:58:13 -0000	1.1
+++ openacs-4/packages/lorsm/www/md/rightsmd.tcl	14 Nov 2004 12:50:11 -0000	1.2
@@ -10,15 +10,15 @@
 }
 
 # set context & title
-set context [list "IMS Metadata Editor - Rights MD"]
+set context [list [list [export_vars -base "." ims_md_id] "IMS Metadata Editor"]  "Rights MD"]
 set title "Rights MD"
 
 # Rights Cost
 template::list::create \
     -name d_ri_cost \
     -multirow d_ri_cost \
     -no_data "No Cost Available" \
-    -actions [list "Add Cost" [export_vars -base educationalmd_cost {ims_md_id}] "Add another Cost"] \
+    -actions [list "Add Cost" [export_vars -base rightsmd/rights_cost {ims_md_id}] "Add another Cost"] \
     -html { align right style "width: 100%;" } \
     -elements {
         cost {
@@ -40,7 +40,7 @@
     -name d_ri_caor \
     -multirow d_ri_caor \
     -no_data "No Copyright or other Restrictions Available" \
-    -actions [list "Add Copyright or other Restrictions" [export_vars -base educationalmd_caor {ims_md_id}] "Add another Copyright or other Restrictions"] \
+    -actions [list "Add Copyright or other Restrictions" [export_vars -base rightsmd/rights_caor {ims_md_id}] "Add another Copyright or other Restrictions"] \
     -html { align right style "width: 100%;" } \
     -elements {
         caor {
@@ -61,8 +61,8 @@
 template::list::create \
     -name d_ri_desc \
     -multirow d_ri_desc \
-    -no_data "No Description  Available" \
-    -actions [list "Add Description" [export_vars -base educationalmd_desc {ims_md_id}] "Add another Description"] \
+    -no_data "No Description Available" \
+    -actions [list "Add Description" [export_vars -base rightsmd/rights_desc {ims_md_id}] "Add another Description"] \
     -html { align right style "width: 100%;" } \
     -elements {
         desc {
@@ -77,4 +77,4 @@
            ims_md_rights
     where
            ims_md_id = :ims_md_id
-} 
\ No newline at end of file
+} 
Index: openacs-4/packages/lorsm/www/md/technicalmd.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/technicalmd.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lorsm/www/md/technicalmd.adp	22 Apr 2004 03:58:13 -0000	1.1
+++ openacs-4/packages/lorsm/www/md/technicalmd.adp	14 Nov 2004 12:50:11 -0000	1.2
@@ -45,4 +45,4 @@
       <td><listtemplate name= "d_te_dur"></listtemplate></td>
     </tr> 
 
-  </table>
\ No newline at end of file
+  </table>
Index: openacs-4/packages/lorsm/www/md/technicalmd.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/technicalmd.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lorsm/www/md/technicalmd.tcl	22 Apr 2004 03:58:13 -0000	1.1
+++ openacs-4/packages/lorsm/www/md/technicalmd.tcl	14 Nov 2004 12:50:11 -0000	1.2
@@ -10,15 +10,15 @@
 }
 
 # set context & title
-set context [list "IMS Metadata Editor - Technical MD"]
+set context [list [list [export_vars -base "." ims_md_id] "IMS Metadata Editor"]  "Technical MD"]
 set title "Technical MD"
 
 # Technical Format
 template::list::create \
     -name d_te_form \
     -multirow d_te_form \
     -no_data "No Format Available" \
-    -actions [list "Add Format" [export_vars -base technicalmd_form {ims_md_id}] "Add another Format"] \
+    -actions [list "Add Format" [export_vars -base technicalmd/technical_form {ims_md_id}] "Add another Format"] \
     -html { align right style "width: 100%;" } \
     -elements {
         format {
@@ -40,17 +40,17 @@
     -name d_te_size \
     -multirow d_te_size \
     -no_data "No Size Available" \
-    -actions [list "Add Size" [export_vars -base technicalmd_size {ims_md_id}] "Add another Size"] \
+    -actions [list "Add Size" [export_vars -base technicalmd/technical_size {ims_md_id}] "Add another Size"] \
     -html { align right style "width: 100%;" } \
     -elements {
-        t_size {
+        t_size_bytes {
             label ""
         }
     }
 
 db_multirow d_te_size select_te_size {
     select 
-           t_size
+           t_size || ' bytes' as t_size_bytes
     from 
            ims_md_technical
     where
@@ -62,7 +62,7 @@
     -name d_te_loca \
     -multirow d_te_loca \
     -no_data "No Location Available" \
-    -actions [list "Add Location" [export_vars -base technicalmd_loca {ims_md_id}] "Add another Location"] \
+    -actions [list "Add Location" [export_vars -base technicalmd/technical_loca {ims_md_id}] "Add another Location"] \
     -html { align right style "width: 100%;" } \
     -elements {
         type {
@@ -88,7 +88,7 @@
     -name d_te_req \
     -multirow d_te_req \
     -no_data "No Requirements Available" \
-    -actions [list "Add Requirements" [export_vars -base technicalmd_req {ims_md_id}] "Add another Requirement"] \
+    -actions [list "Add Requirements" [export_vars -base technicalmd/technical_req {ims_md_id}] "Add another Requirement"] \
     -html { align right style "width: 100%;" } \
     -elements {
         type {
@@ -117,12 +117,12 @@
            ims_md_id = :ims_md_id
 } 
 
-# Technical Installation remarks
+# Technical Installation Remarks
 template::list::create \
     -name d_te_inst \
     -multirow d_te_inst \
     -no_data "No Installation Remarks Available" \
-    -actions [list "Add Installation Remark" [export_vars -base technicalmd_inst {ims_md_id}] "Add another Installation remark"] \
+    -actions [list "Add Installation Remark" [export_vars -base technicalmd/technical_inst {ims_md_id}] "Add another Installation remark"] \
     -html { align right style "width: 100%;" } \
     -elements {
         instl_rmrks {
@@ -144,7 +144,7 @@
     -name d_te_otr \
     -multirow d_te_otr \
     -no_data "No Other Platform Requirements Available" \
-    -actions [list "Add Other Platform Requirements" [export_vars -base technicalmd_otr {ims_md_id}] "Add another Other Platform Requiements"] \
+    -actions [list "Add Other Platform Requirements" [export_vars -base technicalmd/technical_otr {ims_md_id}] "Add another Other Platform Requiements"] \
     -html { align right style "width: 100%;" } \
     -elements {
         otr_plt {
@@ -166,21 +166,25 @@
     -name d_te_dur \
     -multirow d_te_dur \
     -no_data "No Duration Available" \
-    -actions [list "Add Duration" [export_vars -base technicalmd_dur {ims_md_id}] "Add another Duration"] \
+    -actions [list "Add Duration" [export_vars -base technicalmd/technical_dur {ims_md_id}] "Add another Duration"] \
     -html { align right style "width: 100%;" } \
     -elements {
-        duration {
+        duration_sec {
             label ""
         }
-        dur_descrip {
-            label ""
-        }
+        duration_l {
+	    label ""
+	}
+	duration_s {
+	    label ""
+	}
     }
 
 db_multirow d_te_dur select_te_dur {
     select 
-    duration,
-    '[' || duration_l || ']' || ' ' || duration_s as dur_descrip
+    duration_l,
+    duration_s,
+    duration || 's' as duration_sec
     from 
            ims_md_technical
     where
Index: openacs-4/packages/lorsm/www/md/annotationmd/annotation.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/annotationmd/Attic/annotation.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/annotationmd/annotation.adp	14 Nov 2004 12:50:11 -0000	1.1
@@ -0,0 +1,28 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"/>
+
+  <table cellspacing="2" cellpadding="2" border="0">
+    <tr class="form-section">
+      <th colspan="2">Annotation Metadata</th>
+    </tr>
+
+    <tr class="form-section">
+      <td class="form-section">Entity: </td>
+      <td><listtemplate name= "d_an_ent"></listtemplate></td>
+    </tr>   
+
+     <tr class="form-section">
+      <td class="form-section">Date: </td>
+      <td><listtemplate name= "d_an_date"></listtemplate></td>
+    </tr>   
+
+     <tr class="form-section">
+      <td class="form-section">Descriptions: </td>
+      <td><listtemplate name= "d_an_desc"></listtemplate></td>
+    </tr>   
+
+  </table>
Index: openacs-4/packages/lorsm/www/md/annotationmd/annotation.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/annotationmd/Attic/annotation.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/annotationmd/annotation.tcl	14 Nov 2004 12:50:11 -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 2004/11/14 12:50:11 ernieg Exp $
+
+} {
+    ims_md_an_id:integer
+    ims_md_id:integer
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"] [list [export_vars -base "../annotationmd" ims_md_id] "Annotation MD"] "Annotation Entry"]
+set title "Annotation MD"
+
+# Annotation Entity
+template::list::create \
+    -name d_an_ent \
+    -multirow d_an_ent \
+    -no_data "No Entity Available" \
+    -actions [list "Add Entity" [export_vars -base annotation_ent {ims_md_an_id ims_md_id}] "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 "No Date Available" \
+    -actions [list "Add Date" [export_vars -base annotation_date {ims_md_an_id ims_md_id}] "Add another Date"] \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        date {
+            label "Date"
+        }
+	datels {
+	    label "Description"
+	}
+    }
+
+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 "No Description Available" \
+    -actions [list "Add Description" [export_vars -base annotation_desc {ims_md_an_id ims_md_id}] "Add another Description"] \
+    -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/lorsm/www/md/annotationmd/annotation_add.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/annotationmd/Attic/annotation_add.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/annotationmd/annotation_add.adp	14 Nov 2004 12:50:11 -0000	1.1
@@ -0,0 +1,22 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<h3>Annotation Metadata Entry</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Annotation Metadata</th>
+    </tr>
+    <tr>
+      <td>Add another Annotation Metadata Entry?</td>
+    </tr>   
+    <tr>
+      <formtemplate id="annotationmd_add" style="standard-lars"></formtemplate>
+    </tr>
+  </table>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/annotationmd/annotation_add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/annotationmd/Attic/annotation_add.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/annotationmd/annotation_add.tcl	14 Nov 2004 12:50:11 -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 2004/11/14 12:50:11 ernieg Exp $
+
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"] [list [export_vars -base "../annotationmd" ims_md_id] "Annotation MD"] "Annotation Entry"]
+set title "Add Annotation MD Entry"
+
+# 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/lorsm/www/md/annotationmd/annotation_date.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/annotationmd/Attic/annotation_date.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/annotationmd/annotation_date.adp	14 Nov 2004 12:50:11 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Annotation Metadata Date</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Annotation Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Date: </td>
+      <td><listtemplate name= "d_an_date"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Annotation Metadata Date</h3>
+<blockquote>
+ <formtemplate id="annotationmd_date" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/annotationmd/annotation_date.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/annotationmd/Attic/annotation_date.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/annotationmd/annotation_date.tcl	14 Nov 2004 12:50:11 -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 2004/11/14 12:50:11 ernieg 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] "IMS Metadata Editor"] [list [export_vars -base "../annotationmd" ims_md_id] "Annotation MD"] [list [export_vars -base "annotation" {ims_md_id ims_md_an_id}] "Annotation Entry"] "Add/Edit Date"]
+set title "Edit Annotation MD Date"
+
+
+# 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 "Add/Edit Annotation MD Date"}	
+	{html {size 10}}
+	{help_text "Date of contribution"}
+	{label "Date:"}
+    }
+
+    {date_l:text,nospell,optional	
+	{html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English (Required if entering Description)"}
+	{label "Language:"}
+    }
+    
+    {date_s:text(textarea),nospell,optional
+        {html {rows 2 cols 50}}
+	{help_text "Date and Time description"}
+        {label "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 "No Date Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	date {
+            label "Date"
+        }
+	datels {
+	    label "Description"
+	}
+    }
+
+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/lorsm/www/md/annotationmd/annotation_desc.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/annotationmd/Attic/annotation_desc.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/annotationmd/annotation_desc.adp	14 Nov 2004 12:50:11 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Annotation Metadata Description</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Annotation Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Description: </td>
+      <td><listtemplate name= "d_an_desc"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Annotation Metadata Description</h3>
+<blockquote>
+ <formtemplate id="annotationmd_desc" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/annotationmd/annotation_desc.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/annotationmd/Attic/annotation_desc.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/annotationmd/annotation_desc.tcl	14 Nov 2004 12:50:11 -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 2004/11/14 12:50:11 ernieg 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] "IMS Metadata Editor"] [list [export_vars -base "../annotationmd" ims_md_id] "Annotation MD"] [list [export_vars -base "annotation" {ims_md_id ims_md_an_id}] "Annotation Entry"] "Edit Description"]
+    set title "Edit Annotation MD Description"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"] [list [export_vars -base "../annotationmd" ims_md_id] "Annotation MD"] [list [export_vars -base "annotation" {ims_md_id ims_md_an_id}] "Annotation Entry"] "Add Description"]
+    set title "Add Annotation MD Description"
+}
+
+# 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 "Add/Edit Annotation MD Description"}	
+	{html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+	{label "Language:"}
+    }
+
+    {descrip_s:text(textarea),nospell	
+	{html {rows 2 cols 50}}
+	{help_text "Content of the annotation"}
+	{label "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 "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/lorsm/www/md/annotationmd/annotation_ent.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/annotationmd/Attic/annotation_ent.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/annotationmd/annotation_ent.adp	14 Nov 2004 12:50:11 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Annotation Metadata Entity</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Annotation Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Entity: </td>
+      <td><listtemplate name= "d_an_ent"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Annotation Metadata Entity</h3>
+<blockquote>
+ <formtemplate id="annotationmd_ent" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/annotationmd/annotation_ent.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/annotationmd/Attic/annotation_ent.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/annotationmd/annotation_ent.tcl	14 Nov 2004 12:50:11 -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 2004/11/14 12:50:11 ernieg 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] "IMS Metadata Editor"] [list [export_vars -base "../annotationmd" ims_md_id] "Annotation MD"] [list [export_vars -base "annotation" {ims_md_id ims_md_an_id}] "Annotation Entry"] "Add/Edit Entity"]
+set title "Edit Annotation MD Entity"
+
+
+# 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 "Add/Edit Annotation MD Entity"}
+        {html {rows 5 cols 50}}
+	{help_text "Annotator"}
+        {label "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 "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/lorsm/www/md/classificationmd/classification.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,28 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"/>
+
+  <table cellspacing="2" cellpadding="2" border="0">
+    <tr class="form-section">
+      <th colspan="2">Classification Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Purpose: </td>
+      <td><listtemplate name= "d_cl_pur"></listtemplate></td>
+    </tr> 
+    <tr class="form-section">
+      <td class="form-section">Taxonomic Paths: </td>
+      <td><listtemplate name= "d_cl_tpath"></listtemplate></td>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Descriptions: </td>
+      <td><listtemplate name= "d_cl_desc"></listtemplate></td>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Keywords: </td>
+      <td><listtemplate name= "d_cl_key"></listtemplate></td>
+    </tr>	  
+  </table>
Index: openacs-4/packages/lorsm/www/md/classificationmd/classification.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification.tcl	14 Nov 2004 12:50:12 -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 2004/11/14 12:50:12 ernieg Exp $
+
+} {
+    ims_md_cl_id:integer
+    ims_md_id:integer
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"] [list [export_vars -base "../classificationmd" ims_md_id] "Classification MD"] "Classification Entry"]
+set title "Classification MD"
+
+# Classification Purpose
+template::list::create \
+    -name d_cl_pur \
+    -multirow d_cl_pur \
+    -no_data "No Purpose Available" \
+    -actions [list "Add Purpose" [export_vars -base classification_pur {ims_md_cl_id ims_md_id}] "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 "No Taxonomic Paths Available" \
+    -actions [list "Add Taxonomic Path" [export_vars -base classification_addpath {ims_md_cl_id ims_md_id}] "Add another Taxonomic Path"] \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        source {
+            label ""
+        }
+	export {
+            display_eval {\[View\]}
+            link_url_eval { [export_vars -base "classification_tpath" {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] }
+            link_html {title "View associated Taxonomic Path Entry"}
+            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 "No Description Available" \
+    -actions [list "Add Description" [export_vars -base classification_desc {ims_md_cl_id ims_md_id}] "Add another Description"] \
+    -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 "No Keywords Available" \
+    -actions [list "Add Keyword" [export_vars -base classification_key {ims_md_cl_id ims_md_id}] "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/lorsm/www/md/classificationmd/classification_add.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_add.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_add.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,22 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<h3>Classification Metadata Entry</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Classification Metadata</th>
+    </tr>
+    <tr>
+      <td>Add another Classification Metadata Entry?</td>
+    </tr>   
+    <tr>
+      <formtemplate id="classificationmd_add" style="standard-lars"></formtemplate>
+    </tr>
+  </table>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/classificationmd/classification_add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_add.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_add.tcl	14 Nov 2004 12:50:12 -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 "IMS Metadata Editor - Classification MD"]
+set title "Add Classification MD Entry"
+
+# 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/lorsm/www/md/classificationmd/classification_addpath.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_addpath.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_addpath.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,22 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<h3>Classification Metadata</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Classification Metadata</th>
+    </tr>
+    <tr>
+      <td>Add another Classification Metadata Taxonomic Path Entry?</td>
+    </tr>   
+    <tr>
+      <formtemplate id="classificationmd_addpath" style="standard-lars"></formtemplate>
+    </tr>
+  </table>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/classificationmd/classification_addpath.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_addpath.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_addpath.tcl	14 Nov 2004 12:50:12 -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 2004/11/14 12:50:12 ernieg 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] "IMS Metadata Editor"] [list [export_vars -base "../classificationmd" ims_md_id] "Classification MD"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id}] "Classification Entry"] "Add Taxonomic Path Entry"]
+set title "Add Classification MD Taxonomic Path Entry"
+
+# 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/lorsm/www/md/classificationmd/classification_desc.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_desc.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_desc.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Classification Metadata Description</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Classification Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Descriptions: </td>
+      <td><listtemplate name= "d_cl_desc"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Classification Metadata Description</h3>
+<blockquote>
+ <formtemplate id="classificationmd_desc" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/classificationmd/classification_desc.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_desc.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_desc.tcl	14 Nov 2004 12:50:12 -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 2004/11/14 12:50:12 ernieg 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] "IMS Metadata Editor"] [list [export_vars -base "../classificationmd" ims_md_id] "Classification MD"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id}] "Classification Entry"] "Edit Description"]
+    set title "Edit Classification MD Description"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"] [list [export_vars -base "../classificationmd" ims_md_id] "Classification MD"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id}] "Classification Entry"] "Add Description"]
+    set title "Add Classification MD Description"
+}
+
+# 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 "Add/Edit Classification MD Description"}	
+	{html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+	{label "Language:"}
+    }
+
+    {descrip_s:text(textarea),nospell	
+	{html {rows 2 cols 50}}
+	{help_text "Description of the learning object relative to its stated purpose"}
+	{label "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 "No Description Available" \
+    -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 "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/lorsm/www/md/classificationmd/classification_key.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_key.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_key.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Classification Metadata Keyword</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Classification Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Keywords: </td>
+      <td><listtemplate name= "d_cl_key"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Classification Metadata Keyword</h3>
+<blockquote>
+ <formtemplate id="classificationmd_key" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/classificationmd/classification_key.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_key.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_key.tcl	14 Nov 2004 12:50:12 -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 2004/11/14 12:50:12 ernieg 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] "IMS Metadata Editor"] [list [export_vars -base "../classificationmd" ims_md_id] "Classification MD"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id}] "Classification Entry"] "Edit Keyword"]
+    set title "Edit Classification MD Keyword"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"] [list [export_vars -base "../classificationmd" ims_md_id] "Classification MD"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id}] "Classification Entry"] "Add Keyword"]
+    set title "Add Classification MD Keyword"
+}
+
+# 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 "Add/Edit Classification MD Keyword"}	
+	{html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+	{label "Language:"}
+    }
+
+    {keyword_s:text,nospell	
+	{html {size 20}}
+	{help_text "Keyword description of the resource"}
+	{label "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 "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 "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/lorsm/www/md/classificationmd/classification_pur.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_pur.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_pur.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Classification Metadata Purpose</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Classification Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Purpose: </td>
+      <td><listtemplate name= "d_cl_pur"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Classification Metadata Purpose</h3>
+<blockquote>
+ <formtemplate id="classificationmd_pur" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/classificationmd/classification_pur.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_pur.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_pur.tcl	14 Nov 2004 12:50:12 -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 2004/11/14 12:50:12 ernieg 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] "IMS Metadata Editor"] [list [export_vars -base "../classificationmd" ims_md_id] "Classification MD"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id}] "Classification Entry"] "Add/Edit Purpose"]
+set title "Edit Classification MD Purpose"
+
+
+# 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 "Add/Edit Classification MD Purpose"}
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "Source:"}
+    }
+    
+    {purpose_v:text,nospell
+        {html {size 20}}
+	{help_text "Characteristics of the resource described by this classification entry"}
+        {label "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 "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/lorsm/www/md/classificationmd/classification_taxon.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_taxon.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_taxon.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Classification Metadata Taxonomic Path Taxonomy</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Classification Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Keywords: </td>
+      <td><listtemplate name= "d_cl_taxon"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Classification Metadata Taxonomic Path Taxonomy</h3>
+<blockquote>
+ <formtemplate id="classificationmd_taxon" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/classificationmd/classification_taxon.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_taxon.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_taxon.tcl	14 Nov 2004 12:50:12 -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 2004/11/14 12:50:12 ernieg 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] "IMS Metadata Editor"] [list [export_vars -base "../classificationmd" ims_md_id] "Classification MD"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] "Classification Entry"] [list [export_vars -base "classification_tpath" {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] "Taxonomic Paths"] "Edit Taxonomy"]
+    set title "Edit Classification MD Taxonomic Path Taxonomy"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"] [list [export_vars -base "../classificationmd" ims_md_id] "Classification MD"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] "Classification Entry"] [list [export_vars -base "classification_tpath" {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] "Taxonomic Paths"] "Add Taxonomy"]
+    set title "Add Classification MD Taxonomic Path Taxonomy"
+}
+
+# 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 "Add/Edit Classification MD Taxonomic Path Taxonomy"}	
+	{html {size 50}}
+	{help_text "Taxon's identifier in taxonomic system"}
+	{label "Identifier:"}
+    }
+
+    {entry_l:text,nospell	
+	{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}
+    } 
+
+    {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 "No Taxonomies Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	identifier {
+	    label "ID"
+	}
+	entry {
+	    label "Entry"
+	}
+        export {
+            display_eval {\[Edit\]}
+            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 "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/lorsm/www/md/classificationmd/classification_tpath.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_tpath.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_tpath.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,20 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"/>
+
+  <table cellspacing="2" cellpadding="2" border="0">
+    <tr class="form-section">
+      <th colspan="2">Classification Metadata Taxonomic Path</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Source: </td>
+      <td><listtemplate name= "d_cl_source"></listtemplate></td>
+    </tr> 
+    <tr class="form-section">
+      <td class="form-section">Taxonomies: </td>
+      <td><listtemplate name= "d_cl_taxon"></listtemplate></td>
+    </tr>
+  </table>
Index: openacs-4/packages/lorsm/www/md/classificationmd/classification_tpath.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_tpath.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_tpath.tcl	14 Nov 2004 12:50:12 -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 2004/11/14 12:50:12 ernieg 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] "IMS Metadata Editor"] [list [export_vars -base "../classificationmd" ims_md_id] "Classification MD"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] "Classification Entry"] "Taxonomic Paths"]
+set title "Classification MD Taxonomic Path"
+
+# Classification Taxonomic Path Source
+template::list::create \
+    -name d_cl_source \
+    -multirow d_cl_source \
+    -no_data "No Source Available" \
+    -actions [list "Add Source" [export_vars -base classification_tsource {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] "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 "No Taxonomies Available" \
+    -actions [list "Add Taxonomy" [export_vars -base classification_taxon {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] "Add another Taxonomy"] \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	identifier {
+	    label "ID"
+	}
+	entry {
+	    label "Entry"
+	}
+    }
+
+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/lorsm/www/md/classificationmd/classification_tsource.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_tsource.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_tsource.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Classification Metadata Taxonomic Path Source</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Classification Metadata Taxonomic Path</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Source: </td>
+      <td><listtemplate name= "d_cl_tsource"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Classification Metadata Taxonomic Path Source</h3>
+<blockquote>
+ <formtemplate id="classificationmd_tsource" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/classificationmd/classification_tsource.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/classificationmd/Attic/classification_tsource.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/classificationmd/classification_tsource.tcl	14 Nov 2004 12:50:12 -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 2004/11/14 12:50:12 ernieg 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] "IMS Metadata Editor"] [list [export_vars -base "../classificationmd" ims_md_id] "Classification MD"] [list [export_vars -base "classification" {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] "Classification Entry"] [list [export_vars -base "classification_tpath" {ims_md_id ims_md_cl_id ims_md_cl_ta_id}] "Taxonomic Paths"] "Add/Edit Source"]
+
+set title "Edit Classification MD Taxonomic Path Source"
+
+
+# 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 "Add/Edit Classification MD Taxonomic Path Source"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "Language:"}
+    }
+    
+    {source_v:text,nospell
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "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 "No Taxonomic Path Source Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	source {
+            label ""
+        }
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "classification_tsource" {ims_md_cl_ta_id ims_md_cl_id ims_md_id}] }
+            link_html {title "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/lorsm/www/md/educationalmd/educational_cont.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_cont.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_cont.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Educational Metadata Context</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Educational Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Context: </td>
+      <td><listtemplate name= "d_ed_cont"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Educational Metadata Context</h3>
+<blockquote>
+ <formtemplate id="educationalmd_cont" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/educationalmd/educational_cont.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_cont.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_cont.tcl	14 Nov 2004 12:50:12 -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 2004/11/14 12:50:12 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" im\s_md_id] "Educational MD"] "Edit Context"]
+    set title "Edit Educational MD Context"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" im\s_md_id] "Educational MD"] "Add Context"]
+    set title "Add Educational MD Context"
+}
+
+# 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 "Add/Edit Educational MD Context"}
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "Source:"}
+    }
+
+    {context_v:text,nospell
+        {html {size 20}}
+	{help_text "Learning environment where use of learning object is intended to take place"}
+        {label "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 "No Context Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	context {
+            label "Context"
+        }
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "educational_cont" {ims_md_ed_co_id ims_md_id}] }
+            link_html {title "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/lorsm/www/md/educationalmd/educational_desc.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_desc.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_desc.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Educational Metadata Description</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Educational Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Description: </td>
+      <td><listtemplate name= "d_ed_desc"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Educational Metadata Description</h3>
+<blockquote>
+ <formtemplate id="educationalmd_desc" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/educationalmd/educational_desc.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_desc.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_desc.tcl	14 Nov 2004 12:50:12 -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 2004/11/14 12:50:12 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" ims_md_id] "Educational MD"] "Edit Description"]
+    set title "Edit Educational MD Description"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" ims_md_id] "Educational MD"] "Add Description"]
+    set title "Add Educational MD Description"
+}
+
+# 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 "Add/Edit Educational MD Description"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "Language:"}
+    }
+
+    {descrip_s:text(textarea),nospell
+        {html {rows 2 cols 50}}
+	{help_text "How the learning object is to be used"}
+        {label "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 "No Description Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	desc {
+            label "Description"
+        }
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "educational_desc" {ims_md_ed_de_id ims_md_id}] }
+            link_html {title "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/lorsm/www/md/educationalmd/educational_dif.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_dif.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_dif.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Educational Metadata Difficulty</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Educational Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Difficulty: </td>
+      <td><listtemplate name= "d_ed_dif"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Educational Metadata Difficulty</h3>
+<blockquote>
+ <formtemplate id="educationalmd_dif" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/educationalmd/educational_dif.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_dif.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_dif.tcl	14 Nov 2004 12:50:12 -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 2004/11/14 12:50:12 ernieg Exp $
+    
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" ims_md_id] "Educational MD"] "Add/Edit Difficulty"]
+set title "Add/Edit Educational MD Difficulty"
+
+# Form
+
+ad_form -name educationalmd_dif \
+    -cancel_url ../educationalmd?ims_md_id=$ims_md_id \
+    -mode edit \
+    -form {
+
+    {difficulty_s:text,nospell
+	{section "Add/Edit Educational MD Difficulty"}
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "Source:"}
+    }
+
+    {difficulty_v:text,nospell
+        {html {size 10}}
+	{help_text "Level of difficulty in working through the learning object"}
+        {label "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 "No Difficulty Type Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	diff {
+            label "Difficulty"
+        }
+    }
+
+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/lorsm/www/md/educationalmd/educational_ieur.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_ieur.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_ieur.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Educational Metadata Intended End User Role</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Educational Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Intended End User Role: </td>
+      <td><listtemplate name= "d_ed_ieur"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Educational Metadata Intended End User Role</h3>
+<blockquote>
+ <formtemplate id="educationalmd_ieur" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/educationalmd/educational_ieur.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_ieur.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_ieur.tcl	14 Nov 2004 12:50:12 -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 2004/11/14 12:50:12 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" ims_md_id] "Educational MD"] "Edit Intended End User Role"]
+    set title "Edit Educational MD Intended End User Role"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" ims_md_id] "Educational MD"] "Add Intended End User Role"]
+    set title "Add Educational MD Intended End User Role"
+}
+
+# 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 "Add/Edit Educational MD Intended End User Role"}
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "Source:"}
+    }
+
+    {ieur_v:text,nospell
+        {html {size 10}}
+	{help_text "Normal user of the learning object"}
+        {label "Intended End User Role:"}
+    }
+
+    {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 "No Intended End User Role Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	ieur {
+            label "Intended End User Role"
+        }
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "educational_ieur" {ims_md_ed_ie_id ims_md_id}] }
+            link_html {title "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/lorsm/www/md/educationalmd/educational_intl.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_intl.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_intl.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Educational Metadata Interactivity Level</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Educational Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Interactivity Level: </td>
+      <td><listtemplate name= "d_ed_intl"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Educational Metadata Interactivity Level</h3>
+<blockquote>
+ <formtemplate id="educationalmd_intl" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/educationalmd/educational_intl.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_intl.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_intl.tcl	14 Nov 2004 12:50:12 -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 2004/11/14 12:50:12 ernieg Exp $
+
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" \im\\\s_md_id] "Educational MD"] "Add/Edit Interactivity Type"]
+
+set title "Edit Educational MD Interactivity Level"
+
+# Form
+
+ad_form -name educationalmd_intl \
+    -cancel_url ../educationalmd?ims_md_id=$ims_md_id \
+    -mode edit \
+    -form {
+
+    {int_level_s:text,nospell
+	{section "Add/Edit Educational MD Interactivity Level"}
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "Source:"}
+    }
+
+    {int_level_v:text,nospell
+        {html {size 10}}
+	{help_text "Level of interactivity supported by the resource"}
+        {label "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 "No Interactivity Level Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	intl {
+            label "Interactivity Level"
+        }
+    }
+
+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/lorsm/www/md/educationalmd/educational_intt.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_intt.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_intt.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Educational Metadata Interactivity Type</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Educational Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Interactivity Type: </td>
+      <td><listtemplate name= "d_ed_intt"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Educational Metadata Interactivity Type</h3>
+<blockquote>
+ <formtemplate id="educationalmd_intt" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/educationalmd/educational_intt.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_intt.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_intt.tcl	14 Nov 2004 12:50:12 -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 2004/11/14 12:50:12 ernieg Exp $
+
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" ims_md_id] "Educational MD"] "Add/Edit Interactivity Type"]
+set title "Add/Edit Educational MD Interactivity Type"
+
+# Form
+
+ad_form -name educationalmd_intt \
+    -cancel_url ../educationalmd?ims_md_id=$ims_md_id \
+    -mode edit \
+    -form {
+
+    {int_type_s:text,nospell
+	{section "Add/Edit Educational MD Interactivity Type"}
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "Source:"}
+    }
+
+    {int_type_v:text,nospell
+        {html {size 10}}
+	{help_text "Type of interactivity supported by the resource"}
+        {label "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 "No Interactivity Type Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	intt {
+            label "Interactivity Type"
+        }
+    }
+
+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/lorsm/www/md/educationalmd/educational_lang.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_lang.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_lang.adp	14 Nov 2004 12:50:12 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Educational Metadata Language</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Educational Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Language: </td>
+      <td><listtemplate name= "d_ed_lang"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Educational Metadata Language</h3>
+<blockquote>
+ <formtemplate id="educationalmd_lang" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/educationalmd/educational_lang.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_lang.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_lang.tcl	14 Nov 2004 12:50:12 -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 2004/11/14 12:50:12 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" ims_md_id] "Educational MD"] "Edit Language"]
+    set title "Edit Educational MD Language"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" ims_md_id] "Educational MD"] "Add Language"]
+    set title "Add Educational MD Language"
+}
+
+# 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 "Add/Edit Educational MD Language"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "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 "No Language Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	language {
+            label "Language"
+        }
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "educational_lang" {ims_md_ed_la_id ims_md_id}] }
+            link_html {title "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/lorsm/www/md/educationalmd/educational_lrt.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_lrt.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_lrt.adp	14 Nov 2004 12:50:13 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Educational Metadata Learning Resource Type</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Educational Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Learning Resource Type: </td>
+      <td><listtemplate name= "d_ed_lrt"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Educational Metadata Learning Resource Type</h3>
+<blockquote>
+ <formtemplate id="educationalmd_lrt" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/educationalmd/educational_lrt.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_lrt.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_lrt.tcl	14 Nov 2004 12:50:13 -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] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" \i\m\\\s_md_id] "Educational MD"] "Edit Learning Resource Type"]
+    set title "Edit Educational MD Learning Resource Type"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" \i\m\\\s_md_id] "Educational MD"] "Add Learning Resource Type"]
+    set title "Add Educational MD Learning Resource Type"
+}
+
+# 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 "Add/Edit Educational MD Learning Resource Type"}
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "Source:"}
+    }
+
+    {lrt_v:text,nospell
+        {html {size 10}}
+	{help_text "Type of interactivity supported by the resource"}
+        {label "Learning Resource Type:"}
+    }
+
+    {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 "No Learning Resource Type Available" \
+    -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 "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/lorsm/www/md/educationalmd/educational_semd.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_semd.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_semd.adp	14 Nov 2004 12:50:13 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Educational Metadata Semantic Density</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Educational Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Semantic Density:</td>
+      <td><listtemplate name= "d_ed_semd"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Educational Metadata Semantic Density</h3>
+<blockquote>
+ <formtemplate id="educationalmd_semd" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/educationalmd/educational_semd.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_semd.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_semd.tcl	14 Nov 2004 12:50:13 -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 2004/11/14 12:50:13 ernieg Exp $
+
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" ims_md_id] "Educational MD"] "Add/Edit Semantic Density"]
+set title "Edit Educational MD Semantic Density"
+
+# Form
+
+ad_form -name educationalmd_semd \
+    -cancel_url ../educationalmd?ims_md_id=$ims_md_id \
+    -mode edit \
+    -form {
+
+    {sem_density_s:text,nospell
+	{section "Add/Edit Educational MD Semantic Density"}
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "Source:"}
+    }
+
+    {sem_density_v:text,nospell
+        {html {size 10}}
+	{help_text "Learning object's usefulness as compared to its size or duration"}
+        {label "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 "No Semantic Density Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	semd {
+            label "Semantic Density"
+        }
+    }
+
+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/lorsm/www/md/educationalmd/educational_tar.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_tar.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_tar.adp	14 Nov 2004 12:50:13 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Educational Metadata Typical Age Range</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Educational Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Typical Age Range: </td>
+      <td><listtemplate name= "d_ed_tar"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Educational Metadata Typical Age Range</h3>
+<blockquote>
+ <formtemplate id="educationalmd_tar" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/educationalmd/educational_tar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_tar.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_tar.tcl	14 Nov 2004 12:50:13 -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 2004/11/14 12:50:13 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" ims_md_id] "Educational MD"] "Edit Typical Age Range"]
+    set title "Edit Educational MD Typical Age Range"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" ims_md_id] "Educational MD"] "Add Typical Age Rang"]
+    set title "Add Educational MD Typical Age Range"
+}
+
+# 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 "Add/Edit Educational MD Typical Age Range"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "Language:"}
+    }
+
+    {tar_s:text,nospell
+        {html {size 20}}
+	{help_text "Age of the typical intended user"}
+        {label "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 "No Typical Age Range Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	tar {
+            label "Typical Age Range"
+        }
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "educational_tar" {ims_md_ed_ta_id ims_md_id}] }
+            link_html {title "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/lorsm/www/md/educationalmd/educational_tlt.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_tlt.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_tlt.adp	14 Nov 2004 12:50:13 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Educational Metadata Typical Learning Time</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Educational Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Typical Learning Time: </td>
+      <td><listtemplate name= "d_ed_tlt"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Educational Metadata Typical Learning Time</h3>
+<blockquote>
+ <formtemplate id="educationalmd_tlt" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/educationalmd/educational_tlt.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/educationalmd/Attic/educational_tlt.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/educationalmd/educational_tlt.tcl	14 Nov 2004 12:50:13 -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 2004/11/14 12:50:13 ernieg Exp $
+
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../educationalmd" ims_md_id] "Educational MD"] "Add/Edit Typical Learning Time"]
+set title "Edit Educational MD Typical Learning Time"
+
+# 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 "Add/Edit Educational MD Typical Learning Time"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "Language:"}
+    }
+
+    {type_lrn_time_s:text(textarea),nospell,optional
+        {html {rows 2 cols 50}}
+	{help_text "Brief Description (Required if entering Language)"}
+        {label "Description:"}
+    }
+
+    {type_lrn_time:text,nospell
+        {html {size 20}}
+	{help_text "Amount of time it takes to work with the resource"}
+        {label "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 "No Typical Learning Time Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	tlt {
+            label "Typical Learning Time"
+        }
+	tlt_ls {
+            label "Language"
+        }
+    }
+
+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/lorsm/www/md/form-md-record/md-record.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/form-md-record/Attic/md-record.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/form-md-record/md-record.adp	14 Nov 2004 12:50:13 -0000	1.1
@@ -0,0 +1 @@
+<listtemplate name="d_pres"></listtemplate>
\ No newline at end of file
Index: openacs-4/packages/lorsm/www/md/form-md-record/md-record.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/form-md-record/Attic/md-record.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/form-md-record/md-record.tcl	14 Nov 2004 12:50:13 -0000	1.1
@@ -0,0 +1,33 @@
+set actions [list]
+
+lappend actions  "General MD" [export_vars -base ../generalmd {ims_md_id}] "View General Metadata"
+lappend actions  "Lifecycle MD" [export_vars -base ../lifecyclemd {ims_md_id}] "View Lifecycle Metadata"
+lappend actions  "Meta MD" [export_vars -base ../metamd {ims_md_id}] "View Meta Metadata"
+lappend actions  "Technical MD" [export_vars -base ../technicalmd {ims_md_id}] "View Technical Metadata"
+lappend actions  "Educational MD" [export_vars -base ../educationalmd {ims_md_id}] "View Educational Metadata"
+lappend actions  "Rights MD" [export_vars -base ../rightsmd {ims_md_id}] "View Rights Metadata"
+lappend actions  "Relation MD" [export_vars -base ../relationmd {ims_md_id}] "View Relation Metadata"
+lappend actions  "Annotation MD" [export_vars -base ../annotationmd {ims_md_id}] "View Annotation Metadata"
+lappend actions  "Classification MD" [export_vars -base ../classificationmd {ims_md_id}] "View Classification Metadata"
+
+
+# Presentation 
+template::list::create \
+    -name d_pres \
+    -multirow d_pres \
+    -no_data "-" \
+    -actions  $actions \
+    -elements {
+        object_type {
+            label "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/lorsm/www/md/generalmd/general_aggl.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_aggl.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_aggl.adp	14 Nov 2004 12:50:14 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>General Metadata Aggregation Level</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">General Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Aggregation Level: </td>
+      <td><listtemplate name= "d_gen_aggl"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit General Metadata Aggregation Level</h3>
+<blockquote>
+ <formtemplate id="generalmd_aggl" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/generalmd/general_aggl.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_aggl.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_aggl.tcl	14 Nov 2004 12:50:14 -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 2004/11/14 12:50:14 ernieg Exp $
+
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../generalmd" im\\\\\s_md_id] "General MD"] "Edit Aggregation Level"]
+set title "Edit General MD Aggregation Level"
+
+# Form
+
+ad_form -name generalmd_aggl \
+    -cancel_url ../generalmd?ims_md_id=$ims_md_id \
+    -mode edit \
+    -form {
+
+
+
+    {agg_level_v:text,nospell
+	{section "Add/Edit General MD Aggregation Level"}
+        {html {size 10}}
+	{help_text "Functional size of the resource"}
+        {label "Aggregation Level:"}
+    }
+    
+    {agg_level_s:text,nospell,optional
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "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 "No Aggregation Level Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        agg_level_s {
+            label "Source"
+        }
+        agg_level_v {
+            label "Value"
+        }
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "general_aggl" {ims_md_id}] }
+            link_html {title "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/lorsm/www/md/generalmd/general_cata.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_cata.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_cata.adp	14 Nov 2004 12:50:14 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>List of General Metadata Catalog-Entries</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">General Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Catalog-Entries: </td>
+      <td><listtemplate name= "d_gen_cata"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit General Metadata Catalog-Entry</h3>
+<blockquote>
+ <formtemplate id="generalmd_cata" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/generalmd/general_cata.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_cata.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_cata.tcl	14 Nov 2004 12:50:14 -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 2004/11/14 12:50:14 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../generalmd" im\s_md_id] "General MD"] "Edit Catalog-Entry"]
+    set title "Edit General MD Catalog-Entry"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../generalmd" im\s_md_id] "General MD"] "Add Catalog-Entry"]
+    set title "Add General MD Catalog-Entry"
+}
+
+# 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 "Add/Edit General 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_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 "No Catalog Entry Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	catalog {
+	    label "Catalog"
+	}
+        entry_l {
+            label "Language"
+        }
+        entry_s {
+            label "Entry"
+        }
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "general_cata" {ims_md_ge_cata_id ims_md_id}] }
+            link_html {title "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/lorsm/www/md/generalmd/general_cover.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_cover.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_cover.adp	14 Nov 2004 12:50:14 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>List of General Metadata Coverages</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">General Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Coverage: </td>
+      <td><listtemplate name= "d_gen_cover"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit General Metadata Coverage</h3>
+<blockquote>
+ <formtemplate id="generalmd_cover" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/generalmd/general_cover.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_cover.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_cover.tcl	14 Nov 2004 12:50:14 -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 2004/11/14 12:50:14 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../generalmd" im\\\s_md_id] "General MD"] "Edit Coverage"]
+    set title "Edit General MD Coverage"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../generalmd" im\\\s_md_id] "General MD"] "Add Coverage"]
+    set title "Add General MD Coverage"
+}
+
+# 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 "Add/Edit General MD Coverage"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "Language:"}
+    }
+    
+    {cover_s:text,nospell
+        {html {size 50}}
+	{help_text "Temporal/spatial characteristics of content"}
+        {label "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 "No Coverage Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        cover_l {
+            label "Language"
+        }
+        cover_s {
+            label "Coverage"
+        }
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "general_cover" {ims_md_ge_cove_id ims_md_id}] }
+            link_html {title "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/lorsm/www/md/generalmd/general_desc.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_desc.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_desc.adp	14 Nov 2004 12:50:14 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>List of General Metadata Descriptions</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">General Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Descriptions: </td>
+      <td><listtemplate name= "d_gen_desc"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit General Metadata Description</h3>
+<blockquote>
+ <formtemplate id="generalmd_desc" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/generalmd/general_desc.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_desc.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_desc.tcl	14 Nov 2004 12:50:14 -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 2004/11/14 12:50:14 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../generalmd" ims_md_id] "General MD"] "Edit Description"]
+    set title "Edit General MD Description"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../generalmd" ims_md_id] "General MD"] "Add Description"]
+    set title "Add General MD Description"
+}
+
+# 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 "Add/Edit General MD Description"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "Language:"}
+    }
+
+    {descrip_s:text(textarea),nospell
+        {html {rows 5 cols 50}}
+	{help_text "Describes learning object's content"}
+        {label "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 "No Description Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        descrip_l {
+            label "Language"
+        }
+	descrip_s {
+	    label "Description"
+	}
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "general_desc" {ims_md_ge_desc_id ims_md_id}] }
+            link_html {title "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/lorsm/www/md/generalmd/general_key.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_key.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_key.adp	14 Nov 2004 12:50:14 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>List of General Metadata Keywords</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">General Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Keywords: </td>
+      <td><listtemplate name= "d_gen_key"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit General Metadata Keyword</h3>
+<blockquote>
+ <formtemplate id="generalmd_key" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/generalmd/general_key.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_key.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_key.tcl	14 Nov 2004 12:50:14 -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 2004/11/14 12:50:14 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../generalmd" im\\\s_md_id] "General MD"] "Edit Keyword"]
+    set title "Edit General MD Keyword"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../generalmd" im\\\s_md_id] "General MD"] "Add Keyword"]
+    set title "Add General MD Keyword"
+}
+
+# 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 "Add/Edit General MD Keyword"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "Language:"}
+    }
+    
+    {keyword_s:text,nospell
+        {html {size 50}}
+	{help_text "Keyword description of the resource"}
+        {label "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 "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 "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/lorsm/www/md/generalmd/general_lang.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_lang.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_lang.adp	14 Nov 2004 12:50:14 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>List of General Metadata Languages</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">General Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Languages: </td>
+      <td><listtemplate name= "d_gen_lang"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit General Metadata Language</h3>
+<blockquote>
+ <formtemplate id="generalmd_lang" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/generalmd/general_lang.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_lang.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_lang.tcl	14 Nov 2004 12:50:14 -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 2004/11/14 12:50:14 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../generalmd" im\\s_md_id] "General MD"] "Edit Language"]
+    set title "Edit General MD Language"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../generalmd" im\\s_md_id] "General MD"] "Add Language"]
+    set title "Add General MD Language"
+}
+
+# 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 "Add/Edit General MD Language"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "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 "No Language Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        language {
+            label "Language"
+        }
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "general_lang" {ims_md_ge_lang_id ims_md_id}] }
+            link_html {title "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/lorsm/www/md/generalmd/general_struc.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_struc.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_struc.adp	14 Nov 2004 12:50:14 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>General Metadata Structure</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">General Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Structure: </td>
+      <td><listtemplate name= "d_gen_struc"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit General Metadata Structure</h3>
+<blockquote>
+ <formtemplate id="generalmd_struc" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/generalmd/general_struc.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_struc.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_struc.tcl	14 Nov 2004 12:50:14 -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 2004/11/14 12:50:14 ernieg Exp $
+
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../generalmd" im\\\\s_md_id] "General MD"] "Edit Structure"]
+set title "Edit General MD Structure"
+
+# Form
+
+ad_form -name generalmd_struc \
+    -cancel_url [export_vars -base "../generalmd" ims_md_id] \
+    -mode edit \
+    -form {
+
+    {structure_v:text
+	{section "Add/Edit General MD Structure"}
+        {html {size 10}}
+	{help_text "Organizational structure of the resource"}
+        {label "Structure:"}
+    }
+    
+    {structure_s:text,nospell,optional
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "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 "No Structure Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        structure_s {
+            label "Source"
+	    html {align center}
+        }
+        structure_v {
+            label "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/lorsm/www/md/generalmd/general_title.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_title.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_title.adp	14 Nov 2004 12:50:14 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>List of General Metadata Titles</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">General Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Titles: </td>
+      <td><listtemplate name= "d_gen_titles"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit General Metadata Title</h3>
+<blockquote>
+ <formtemplate id="generalmd_title" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/generalmd/general_title.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/generalmd/Attic/general_title.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/generalmd/general_title.tcl	14 Nov 2004 12:50:14 -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 2004/11/14 12:50:14 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../generalmd" ims_md_id] "General MD"] "Edit Titles"]
+    set title "Edit General MD Title"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../generalmd" ims_md_id] "General MD"] "Add Titles"]
+#    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  "General MD"]
+    set title "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 "Add/Edit General MD Title"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "Language:"}
+    }
+    
+    {title_s:text,nospell
+        {html {size 50}}
+	{help_text "Learning object's name"}
+        {label "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 "No Titles Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        title_l {
+            label "Language"
+        }
+        title_s {
+            label "Title(s)"
+        }
+        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/lorsm/www/md/lifecyclemd/lifecycle_cont.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/lifecyclemd/Attic/lifecycle_cont.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/lifecyclemd/lifecycle_cont.adp	14 Nov 2004 12:50:15 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Lifecyle Metadata Contribution</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Lifecycle Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Contribution: </td>
+      <td><listtemplate name= "d_lf_cont"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Lifecycle Metadata Contributor</h3>
+<blockquote>
+ <formtemplate id="lifecyclemd_cont" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/lifecyclemd/lifecycle_cont.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/lifecyclemd/Attic/lifecycle_cont.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/lifecyclemd/lifecycle_cont.tcl	14 Nov 2004 12:50:15 -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 2004/11/14 12:50:15 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../lifecyclemd" im\\\\\\\s_md_id] "Life Cycle MD"] "Edit Contributor"]
+    set title "Edit Lifecycle MD Contributor"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../lifecyclemd" im\\\\\\\s_md_id] "Life Cycle MD"] "Add Contributor"]
+    set title "Add Lifecycle MD Contributor"
+}
+
+# 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 "Add/Edit Lifecycle MD Contributor"}
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "Source:"}
+    }
+
+    {role_v:text,nospell
+        {html {size 10}}
+	{help_text "Type of contribution"}
+        {label "Role:"}
+    }
+    {entity:text(textarea),nospell
+        {html {rows 5 cols 50}}
+	{help_text "Entity or entities involved"}
+        {label "Entity:"}
+    }
+
+    {cont_date:text,nospell
+        {html {size 10}}
+	{help_text "Date of contribution"}
+        {label "Date:"}
+    }
+
+    {cont_date_l:text,nospell,optional
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English (Required if entering Description)"}
+        {label "Language:"}
+    }
+
+    {cont_date_s:text(textarea),nospell,optional
+        {html {rows 2 cols 50}}
+	{help_text "Describes contribution"}
+        {label "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 "No Contributors Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        role {
+            label "Role"
+        }
+        entity {
+            label "Entity"
+        }
+	cont_date {
+	    label "Contribution Date"
+	}
+	cont_date_ls {
+	    label "Description"
+	}
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "lifecycle_cont" {ims_md_lf_cont_id ims_md_id}] }
+            link_html {title "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/lorsm/www/md/lifecyclemd/lifecycle_stat.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/lifecyclemd/Attic/lifecycle_stat.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/lifecyclemd/lifecycle_stat.adp	14 Nov 2004 12:50:15 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Lifecyle Metadata Status</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Lifecycle Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Status: </td>
+      <td><listtemplate name= "d_lf_stat"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Lifecycle Metadata Status</h3>
+<blockquote>
+ <formtemplate id="lifecyclemd_stat" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/lifecyclemd/lifecycle_stat.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/lifecyclemd/Attic/lifecycle_stat.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/lifecyclemd/lifecycle_stat.tcl	14 Nov 2004 12:50:15 -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 2004/11/14 12:50:15 ernieg Exp $
+    
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../lifecyclemd" im\\\\\\\s_md_id] "Life Cycle MD"] "Edit Status"]
+set title "Edit Lifecycle MD Status"
+
+# Form
+
+ad_form -name lifecyclemd_stat \
+    -cancel_url ../lifecyclemd?ims_md_id=$ims_md_id \
+    -mode edit \
+    -form {
+
+    {status_v:text,nospell
+	{section "Add/Edit Lifecycle MD Version"}
+        {html {size 10}}
+	{help_text "Learning object's editorial condition"}
+        {label "Status:"}
+    }
+    
+    {status_s:text,nospell,optional
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "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 "No Status Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        status_s {
+            label "Source"
+        }
+        status_v {
+            label "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/lorsm/www/md/lifecyclemd/lifecycle_version.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/lifecyclemd/Attic/lifecycle_version.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/lifecyclemd/lifecycle_version.adp	14 Nov 2004 12:50:15 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Lifecyle Metadata Version</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Lifecycle Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Version: </td>
+      <td><listtemplate name= "d_lf_ver"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Lifecycle Metadata Version</h3>
+<blockquote>
+ <formtemplate id="lifecyclemd_ver" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/lifecyclemd/lifecycle_version.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/lifecyclemd/Attic/lifecycle_version.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/lifecyclemd/lifecycle_version.tcl	14 Nov 2004 12:50:15 -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 2004/11/14 12:50:15 ernieg Exp $
+    
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../lifecyclemd" im\\\\\\s_md_id] "Life Cycle MD"] "Edit Version"]
+set title "Edit Lifecycle MD Version"
+
+# Form
+
+ad_form -name lifecyclemd_ver \
+    -cancel_url ../lifecyclemd?ims_md_id=$ims_md_id \
+    -mode edit \
+    -form {
+
+
+    {version_l:text,nospell,optional
+	{section "Add/Edit Lifecycle MD Version"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "Language:"}
+    }
+    
+    {version_s:text,nospell
+        {html {size 10}}
+	{help_text "Edition of the learning object i.e.: '1.0'"}
+        {label "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 "No Structure Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        version_l {
+            label "Language"
+        }
+        version_s {
+            label "Version"
+        }
+    }
+
+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/lorsm/www/md/metamd/meta_cata.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/metamd/Attic/meta_cata.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/metamd/meta_cata.adp	14 Nov 2004 12:50:16 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>List of Meta Metadata Catalog-Entries</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Meta Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Catalog-Entries: </td>
+      <td><listtemplate name= "d_md_cata"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Meta Metadata Catalog-Entry</h3>
+<blockquote>
+ <formtemplate id="metamd_cata" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/metamd/meta_cata.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/metamd/Attic/meta_cata.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/metamd/meta_cata.tcl	14 Nov 2004 12:50:16 -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 2004/11/14 12:50:16 ernieg 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/lorsm/www/md/metamd/meta_cont.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/metamd/Attic/meta_cont.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/metamd/meta_cont.adp	14 Nov 2004 12:50:16 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Meta Metadata Contribution</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Meta Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Contribution: </td>
+      <td><listtemplate name= "d_md_cont"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Meta Metadata Contributor</h3>
+<blockquote>
+ <formtemplate id="metamd_cont" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/metamd/meta_cont.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/metamd/Attic/meta_cont.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/metamd/meta_cont.tcl	14 Nov 2004 12:50:16 -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 2004/11/14 12:50:16 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../metamd" im\s_\md_id] "Meta Metadata"] "Add Contributor"]
+    set title "Edit Meta MD Contributor"
+} 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 Contributor"]
+    set title "Add Meta MD Contributor"
+}
+
+# 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 "Add/Edit Meta MD Contributor"}
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "Source:"}
+    }
+
+    {role_v:text,nospell
+        {html {size 10}}
+	{help_text "Type of contribution"}
+        {label "Role:"}
+    }
+    
+    {entity:text(textarea),nospell
+        {html {rows 5 cols 50}}
+	{help_text "Entity or entities involved"}
+        {label "Entity:"}
+    }
+
+    {cont_date:text,nospell
+        {html {size 10}}
+	{help_text "Date of contribution"}
+        {label "Date:"}
+    }
+
+    {cont_date_l:text,nospell,optional
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English (Required if entering Description)"}
+        {label "Language:"}
+    }
+
+    {cont_date_s:text(textarea),nospell,optional
+        {html {rows 2 cols 50}}
+	{help_text "Describes contribution"}
+        {label "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 "No Contributors Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        role {
+            label "Role"
+        }
+        entity {
+            label "Entity"
+        }
+	cont_date {
+	    label "Contribution Date"
+	}
+	cont_date_ls {
+	    label "Description"
+	}
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "meta_cont" {ims_md_md_cont_id ims_md_id}] }
+            link_html {title "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/lorsm/www/md/metamd/meta_lang.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/metamd/Attic/meta_lang.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/metamd/meta_lang.adp	14 Nov 2004 12:50:16 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Meta Metadata Language</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Meta Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Language: </td>
+      <td><listtemplate name= "d_md_lang"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Meta Metadata Language</h3>
+<blockquote>
+ <formtemplate id="metamd_lang" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/metamd/meta_lang.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/metamd/Attic/meta_lang.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/metamd/meta_lang.tcl	14 Nov 2004 12:50:16 -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 2004/11/14 12:50:16 ernieg Exp $
+    
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+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 Language"]
+set title "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 "Add/Edit Meta MD Language"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "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 "No Language Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        language {
+            label "Language"
+        }
+    }
+
+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/lorsm/www/md/metamd/meta_scheme.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/metamd/Attic/meta_scheme.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/metamd/meta_scheme.adp	14 Nov 2004 12:50:16 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Meta Metadata Scheme</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Meta Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Scheme: </td>
+      <td><listtemplate name= "d_md_scheme"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Meta Metadata Scheme</h3>
+<blockquote>
+ <formtemplate id="metamd_scheme" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/metamd/meta_scheme.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/metamd/Attic/meta_scheme.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/metamd/meta_scheme.tcl	14 Nov 2004 12:50:16 -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 2004/11/14 12:50:16 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../metamd" im\s_\\md_id] "Meta Metadata"] "Edit Scheme"]
+    set title "Edit Meta MD Scheme"
+} 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 Scheme"]
+    set title "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 "Add/Edit Meta MD Scheme"}
+        {html {size 10}}
+	{help_text "Structure of meta-data including version i.e.: 'IMSv1.2.1'"}
+        {label "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 "No Scheme Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        scheme {
+            label "Scheme"
+        }
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "meta_scheme" {ims_md_id ims_md_md_sch_id}] }
+            link_html {title "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/lorsm/www/md/relationmd/relation.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/relationmd/Attic/relation.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/relationmd/relation.adp	14 Nov 2004 12:50:16 -0000	1.1
@@ -0,0 +1,31 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"/>
+
+  <table cellspacing="2" cellpadding="2" border="0">
+    <tr class="form-section">
+      <th colspan="2">Relation Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Kind: </td>
+      <td><listtemplate name= "d_re_kind"></listtemplate></td>
+    </tr>
+    <tr class="form-section">
+      <th colspan="2">Relation Metadata Resource</th>
+    </tr>	   
+    <tr class="form-section">
+      <td class="form-section">Identifier: </td>
+      <td><listtemplate name= "d_re_ident"></listtemplate></td>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Description: </td>
+      <td><listtemplate name= "d_re_desc"></listtemplate></td>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Catalog-Entries: </td>
+      <td><listtemplate name= "d_re_cata"></listtemplate></td>
+    </tr>
+  </table>
Index: openacs-4/packages/lorsm/www/md/relationmd/relation.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/relationmd/Attic/relation.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/relationmd/relation.tcl	14 Nov 2004 12:50:16 -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 2004/11/14 12:50:16 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../relationmd" ims_md_id] "Relation MD"] "Relation Entry"]
+set title "Relation MD"
+
+# Relation Kind
+template::list::create \
+    -name d_re_kind \
+    -multirow d_re_kind \
+    -no_data "No Kind Available" \
+    -actions [list "Add Kind" [export_vars -base relation_kind {ims_md_re_re_id ims_md_re_id ims_md_id}] "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 "Add Identifier" [export_vars -base relation_ident {ims_md_re_re_id ims_md_re_id ims_md_id}] "Add another Identifier"] \
+    -no_data "No Resource Identifier Available" \
+    -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 "No Catalog-Entries Available" \
+    -actions [list "Add Catalog-Entry" [export_vars -base relation_cata {ims_md_re_re_id ims_md_re_id ims_md_id}] "Add another Catalog-Entry"] \
+    -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 "No Resource Description Available" \
+    -actions [list "Add Description" [export_vars -base relation_desc {ims_md_re_re_id ims_md_re_id ims_md_id}] "Add another Description"] \
+    -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/lorsm/www/md/relationmd/relation_add.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/relationmd/Attic/relation_add.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/relationmd/relation_add.adp	14 Nov 2004 12:50:16 -0000	1.1
@@ -0,0 +1,22 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<h3>Relation Metadata Entry</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Relation Metadata</th>
+    </tr>
+    <tr>
+      <td>Add another Relation Metadata Entry?</td>
+    </tr>   
+    <tr>
+      <formtemplate id="relationmd_add" style="standard-lars"></formtemplate>
+    </tr>
+  </table>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/relationmd/relation_add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/relationmd/Attic/relation_add.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/relationmd/relation_add.tcl	14 Nov 2004 12:50:16 -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 2004/11/14 12:50:16 ernieg Exp $
+
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../relationmd" ims_md_id] "Relation MD"] "Add Relation Entry"]
+set title "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/lorsm/www/md/relationmd/relation_cata.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/relationmd/Attic/relation_cata.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/relationmd/relation_cata.adp	14 Nov 2004 12:50:16 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Relation Metadata Resource Catalog-Entry</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Relation Metadata Resource</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Catalog-Entries: </td>
+      <td><listtemplate name= "d_re_cata"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Relation Metadata Resource Catalog-Entry</h3>
+<blockquote>
+ <formtemplate id="relationmd_cata" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/relationmd/relation_cata.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/relationmd/Attic/relation_cata.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/relationmd/relation_cata.tcl	14 Nov 2004 12:50:16 -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 2004/11/14 12:50:16 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../relationmd" ims_md_id] "Relation MD"] [list [export_vars -base "relation" {ims_md_id ims_md_re_id ims_md_re_re_id}] "Relation Entry"] "Edit Catalog-Entry"]
+    set title "Edit Relation MD Resource Catalog-Entry"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../relationmd" ims_md_id] "Relation MD"] [list [export_vars -base "relation" {ims_md_id ims_md_re_id ims_md_re_re_id}] "Relation Entry"] "Add Catalog-Entry"]
+    set title "Add Relation MD Resource Catalog-Entry"
+}
+
+# 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 "Add/Edit Relation MD Resource 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_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 "No Catalog-Entries Available" \
+    -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 "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/lorsm/www/md/relationmd/relation_desc.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/relationmd/Attic/relation_desc.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/relationmd/relation_desc.adp	14 Nov 2004 12:50:16 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Relation Metadata Resource Description</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Relation Metadata Resource</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Description: </td>
+      <td><listtemplate name= "d_re_desc"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Relation Metadata Resource Description</h3>
+<blockquote>
+ <formtemplate id="relationmd_desc" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/relationmd/relation_desc.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/relationmd/Attic/relation_desc.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/relationmd/relation_desc.tcl	14 Nov 2004 12:50:16 -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 2004/11/14 12:50:16 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../relationmd" ims_md_id] "Relation MD"] [list [export_vars -base "relation" {ims_md_id ims_md_re_id ims_md_re_re_id}] "Relation Entry"] "Add/Edit Description"]
+set title "Edit Relation MD Resource Description"
+
+# 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 "Add/Edit Relation MD Resource Description"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "Language:"}
+    }
+    
+    {descrip_s:text(textarea),nospell
+        {html {rows 2 cols 50}}
+	{help_text "Description of the other resource"}
+        {label "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 "No Resource Description Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	descrip {
+            label "Description"
+        }
+    }
+
+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/lorsm/www/md/relationmd/relation_ident.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/relationmd/Attic/relation_ident.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/relationmd/relation_ident.adp	14 Nov 2004 12:50:16 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Relation Metadata Resource Identifier</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Relation Metadata Resource</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Identifier: </td>
+      <td><listtemplate name= "d_re_ident"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Relation Metadata Resource Identifier</h3>
+<blockquote>
+ <formtemplate id="relationmd_ident" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/relationmd/relation_ident.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/relationmd/Attic/relation_ident.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/relationmd/relation_ident.tcl	14 Nov 2004 12:50:16 -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 2004/11/14 12:50:16 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../relationmd" ims_md_id] "Relation MD"] [list [export_vars -base "relation" {ims_md_id ims_md_re_id ims_md_re_re_id}] "Relation Entry"] "Add/Edit Resource Identifier"]
+set title "Edit Relation MD Resource Identifier"
+
+
+# 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 "Add/Edit Relation MD Resource Identifier"}
+        {html {size 50}}
+	{help_text "Unique identifier of the other resource"}
+        {label "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 "No Resource Identifier Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	identifier {
+            label "Identifier"
+        }
+    }
+
+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/lorsm/www/md/relationmd/relation_kind.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/relationmd/Attic/relation_kind.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/relationmd/relation_kind.adp	14 Nov 2004 12:50:16 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Relation Metadata Kind</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Relation Metadata Kind</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Kind: </td>
+      <td><listtemplate name= "d_re_kind"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Relation Metadata Kind</h3>
+<blockquote>
+ <formtemplate id="relationmd_kind" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/relationmd/relation_kind.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/relationmd/Attic/relation_kind.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/relationmd/relation_kind.tcl	14 Nov 2004 12:50:16 -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 2004/11/14 12:50:16 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../relationmd" ims_md_id] "Relation MD"] [list [export_vars -base "relation" {ims_md_id ims_md_re_id ims_md_re_re_id}] "Relation Entry"] "Add/Edit Kind"]
+set title "Add/Edit Relation MD Kind"
+
+# 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 "Add/Edit Relation MD Kind"}
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "Source:"}
+    }
+    
+    {kind_v:text,nospell
+        {html {size 20}}
+	{help_text "Nature of the relationship between the resource being described and the one identified by Resource"}
+        {label "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 "No Kind Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	kind_s {
+            label "Source"
+        }
+	kind_v {
+	    label "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/lorsm/www/md/rightsmd/rights_caor.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/rightsmd/Attic/rights_caor.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/rightsmd/rights_caor.adp	14 Nov 2004 12:50:16 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Rights Metadata Copyright or other Restrictions</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Rights Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Copyright or other Restrictions: </td>
+      <td><listtemplate name= "d_ri_caor"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Rights Metadata Copyright or other Restrictions</h3>
+<blockquote>
+ <formtemplate id="rightsmd_caor" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/rightsmd/rights_caor.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/rightsmd/Attic/rights_caor.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/rightsmd/rights_caor.tcl	14 Nov 2004 12:50:16 -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 2004/11/14 12:50:16 ernieg Exp $
+
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../rightsmd" ims_md_id] "Rights MD"] "Add/Edit Copyrights or other Restrictions"]
+set title "Edit Rights MD Copyright or other Restrictions"
+
+
+# Form
+
+ad_form -name rightsmd_caor \
+    -cancel_url ../rightsmd?ims_md_id=$ims_md_id \
+    -mode edit \
+    -form {
+
+    {caor_s:text,nospell
+	{section "Add/Edit Rights MD Copyright or other Restrictions"}
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "Source:"}
+    }
+
+    {caor_v:text,nospell
+        {html {size 10}}
+	{help_text "Whether copyright or other restrictions apply"}
+        {label "Copyright or other Restrictions:"}
+    }
+    {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 "No Copyright or other Restrictions Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	caor {
+            label "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/lorsm/www/md/rightsmd/rights_cost.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/rightsmd/Attic/rights_cost.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/rightsmd/rights_cost.adp	14 Nov 2004 12:50:16 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Rights Metadata Cost</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Rights Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Cost: </td>
+      <td><listtemplate name= "d_ri_cost"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Rights Metadata Cost</h3>
+<blockquote>
+ <formtemplate id="rightsmd_cost" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/rightsmd/rights_cost.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/rightsmd/Attic/rights_cost.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/rightsmd/rights_cost.tcl	14 Nov 2004 12:50:16 -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 2004/11/14 12:50:16 ernieg Exp $
+
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../rightsmd" ims_md_id] "Rights MD"] "Add/Edit Cost"]
+set title "Add/Edit Rights MD Cost"
+
+
+# Form
+
+ad_form -name rightsmd_cost \
+    -cancel_url ../rightsmd?ims_md_id=$ims_md_id \
+    -mode edit \
+    -form {
+
+    {cost_s:text,nospell
+	{section "Add/Edit Rights MD Cost"}
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "Source:"}
+    }
+
+    {cost_v:text,nospell
+        {html {size 10}}
+	{help_text "Whether use of the resource requires payment"}
+        {label "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 "No Cost Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	cost {
+            label "Cost"
+        }
+    }
+
+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/lorsm/www/md/rightsmd/rights_desc.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/rightsmd/Attic/rights_desc.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/rightsmd/rights_desc.adp	14 Nov 2004 12:50:16 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Rights Metadata Description</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Rights Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Description: </td>
+      <td><listtemplate name= "d_ri_desc"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Rights Metadata Description</h3>
+<blockquote>
+ <formtemplate id="rightsmd_desc" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/rightsmd/rights_desc.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/rightsmd/Attic/rights_desc.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/rightsmd/rights_desc.tcl	14 Nov 2004 12:50:16 -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 2004/11/14 12:50:16 ernieg Exp $
+
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../rightsmd" ims_md_id] "Rights MD"] "Add/Edit Description"]
+set title "Edit Rights MD Description"
+
+
+# Form
+
+ad_form -name rightsmd_desc \
+    -cancel_url ../rightsmd?ims_md_id=$ims_md_id \
+    -mode edit \
+    -form {
+
+    {descrip_l:text,nospell
+	{section "Add/Edit Rights MD Description"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "Language:"}
+    }
+
+    {descrip_s:text(textarea),nospell
+        {html {rows 2 cols 50}}
+	{help_text "Conditions of use for the resource"}
+        {label "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 "No Description Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	desc {
+            label "Description"
+        }
+    }
+
+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/lorsm/www/md/technicalmd/technical_dur.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/technicalmd/Attic/technical_dur.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/technicalmd/technical_dur.adp	14 Nov 2004 12:50:17 -0000	1.1
@@ -0,0 +1,28 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Technical Metadata Duration</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Technical Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Duration: </td>
+      <td><listtemplate name= "d_te_dur"></listtemplate></td>
+    </tr>   
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Technical Metadata Duration</h3>
+<blockquote>
+ <formtemplate id="technicalmd_dur" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/technicalmd/technical_dur.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/technicalmd/Attic/technical_dur.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/technicalmd/technical_dur.tcl	14 Nov 2004 12:50:17 -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 2004/11/14 12:50:17 ernieg Exp $
+
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../technicalmd" \\\i\\m\\s_md_id] "Technical MD"] "Add/Edit Duration"]
+set title "Edit Technical MD Duration"
+
+# Form
+
+ad_form -name technicalmd_dur \
+    -cancel_url ../technicalmd?ims_md_id=$ims_md_id \
+    -mode edit \
+    -form {
+
+    {duration:text,nospell
+	{section "Add/Edit Technical MD Duration"}
+        {html {size 10}}
+	{help_text "Time the continuous learning object is intended to take (in seconds)"}
+        {label "Duration:"}
+    }
+
+    {duration_l:text,nospell,optional
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "Language:"}
+    }
+
+    {duration_s:text,nospell,optional
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "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 "No Duration Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        duration_sec {
+            label "Duration (Seconds)"
+        }
+	duration_l {
+	    label "Language"
+	}
+	duration_s {
+	    label "Source"
+	}
+
+    }
+
+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/lorsm/www/md/technicalmd/technical_form.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/technicalmd/Attic/technical_form.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/technicalmd/technical_form.adp	14 Nov 2004 12:50:17 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Technical Metadata Format</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Technical Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Formats: </td>
+      <td><listtemplate name= "d_te_form"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Technical Metadata Format</h3>
+<blockquote>
+ <formtemplate id="technicalmd_form" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/technicalmd/technical_form.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/technicalmd/Attic/technical_form.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/technicalmd/technical_form.tcl	14 Nov 2004 12:50:17 -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 2004/11/14 12:50:17 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../technicalmd" im\s_md_id] "Technical MD"] "Edit Format"]
+    set title "Edit Technical MD Format"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../technicalmd" im\s_md_id] "Technical MD"] "Add Format"]
+    set title "Add Technical MD Format"
+}
+
+# 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 "Add/Edit Technical MD Format"}
+        {html {size 30}}
+	{help_text "Technical data type of the resource"}
+        {label "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 "No Format Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        format {
+            label "Format"
+        }
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "technical_form" {ims_md_te_fo_id ims_md_id}] }
+            link_html {title "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/lorsm/www/md/technicalmd/technical_inst.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/technicalmd/Attic/technical_inst.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/technicalmd/technical_inst.adp	14 Nov 2004 12:50:17 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Technical Metadata Installation Remarks</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Technical Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Installation Remarks: </td>
+      <td><listtemplate name= "d_te_inst"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Technical Metadata Installation Remarks</h3>
+<blockquote>
+ <formtemplate id="technicalmd_inst" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/technicalmd/technical_inst.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/technicalmd/Attic/technical_inst.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/technicalmd/technical_inst.tcl	14 Nov 2004 12:50:17 -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 2004/11/14 12:50:17 ernieg Exp $
+
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../technicalmd" \\\im\\s_md_id] "Technical MD"] "Edit Installation Remarks"]
+set title "Add/Edit Technical MD Installation Remarks"
+
+# Form
+
+ad_form -name technicalmd_inst \
+    -cancel_url ../technicalmd?ims_md_id=$ims_md_id \
+    -mode edit \
+    -form {
+
+    {instl_rmrks_l:text,nospell
+	{section "Add/Edit Technical MD Installation Remarks"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "Language:"}
+    }
+
+    {instl_rmrks_s:text(textarea),nospell
+        {html {rows 5 cols 60}}
+	{help_text "Information on how to install the resource"}
+        {label "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 "No Installation Remarks Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        instl_rmrks {
+            label "Installation Remarks"
+        }
+    }
+
+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/lorsm/www/md/technicalmd/technical_loca.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/technicalmd/Attic/technical_loca.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/technicalmd/technical_loca.adp	14 Nov 2004 12:50:17 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>List of Technical Metadata Locations</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Technical Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Locations: </td>
+      <td><listtemplate name= "d_te_loca"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Technical Metadata Format</h3>
+<blockquote>
+ <formtemplate id="technicalmd_loca" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/technicalmd/technical_loca.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/technicalmd/Attic/technical_loca.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/technicalmd/technical_loca.tcl	14 Nov 2004 12:50:17 -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 2004/11/14 12:50:17 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../technicalmd" \im\\s_md_id] "Technical MD"] "Edit Location"]
+    set title "Edit Technical MD Location"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../technicalmd" \im\\s_md_id] "Technical MD"] "Add Location"]
+    set title "Add Technical MD Location"
+}
+
+# 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 "Add/Edit Technical MD Location"}
+        {html {size 10}}
+	{help_text "Reference to location. Only TEXT or URI is permitted"}
+        {label "Type:"}
+    }
+
+    {location:text,nospell
+        {html {size 50}}
+	{help_text "Location of the resource"}
+        {label "Location:"}
+    }
+
+    {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 "No Location Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+	type {
+	    label "Type"
+	}
+        location {
+            label "Location"
+        }
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "technical_loca" {ims_md_te_lo_id ims_md_id}] }
+            link_html {title "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/lorsm/www/md/technicalmd/technical_otr.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/technicalmd/Attic/technical_otr.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/technicalmd/technical_otr.adp	14 Nov 2004 12:50:17 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Technical Metadata Other Platform Requirements</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Technical Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Other Platform Requirements: </td>
+      <td><listtemplate name= "d_te_otr"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Technical Metadata Other Platform Requirements</h3>
+<blockquote>
+ <formtemplate id="technicalmd_otr" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/technicalmd/technical_otr.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/technicalmd/Attic/technical_otr.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/technicalmd/technical_otr.tcl	14 Nov 2004 12:50:17 -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 2004/11/14 12:50:17 ernieg Exp $
+
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../technicalmd" \\\i\m\\s_md_id] "Technical MD"] "Add/Edit Other Platform Requirements"]
+set title "Add/Edit Technical MD Other Platform Requirements"
+
+# Form
+
+ad_form -name technicalmd_otr \
+    -cancel_url ../technicalmd?ims_md_id=$ims_md_id \
+    -mode edit \
+    -form {
+
+    {otr_plt_l:text,nospell
+	{section "Add/Edit Technical MD Other Platform Requirements"}
+        {html {size 10}}
+	{help_text "i.e.: 'en_AU' for Australian English"}
+        {label "Language:"}
+    }
+
+    {otr_plt_s:text(textarea),nospell
+        {html {rows 5 cols 60}}
+	{help_text "Information on other hardware and software requirements"}
+        {label "Other Platform Requirements:"}
+    }
+    {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 "No Other Platform Requirements Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        otr_plt {
+            label "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/lorsm/www/md/technicalmd/technical_req.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/technicalmd/Attic/technical_req.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/technicalmd/technical_req.adp	14 Nov 2004 12:50:17 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>List of Technical Metadata Requirements</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Technical Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Requirements: </td>
+      <td><listtemplate name= "d_te_req"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Technical Metadata Requirement</h3>
+<blockquote>
+ <formtemplate id="technicalmd_req" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/technicalmd/technical_req.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/technicalmd/Attic/technical_req.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/technicalmd/technical_req.tcl	14 Nov 2004 12:50:17 -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 2004/11/14 12:50:17 ernieg 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] "IMS Metadata Editor"]  [list [export_vars -base "../technicalmd" \\im\\s_md_id] "Technical MD"] "Edit Requirement"]
+    set title "Edit Technical MD Requirement"
+} else {
+    set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../technicalmd" \\im\\s_md_id] "Technical MD"] "Add Requirement"]
+    set title "Add Technical MD Requirement"
+}
+
+# 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 "Add/Edit Technical MD Requirement"}
+        {html {size 10}}
+	{help_text "Source of vocabulary items i.e.: 'LOMv1.0'"}
+        {label "Source:"}
+    }
+
+    {type_v:text,nospell
+        {html {size 20}}
+	{help_text "Type of requirement"}
+        {label "Type:"}
+    }
+    
+    {name_v:text,nospell
+        {html {size 20}}
+	{help_text "Name of required item"}
+        {label "Name:"}
+    }
+    
+    {min_version:text,nospell
+        {html {size 10}}
+	{help_text "Lowest version of the required item"}
+        {label "Minimum Version:"}
+    }
+
+    {max_version:text,nospell
+        {html {size 10}}
+	{help_text "Highest version of the required item"}
+        {label "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 "Type"
+        }
+        name {
+            label "Name"
+        }
+	min_version {
+	    label "Min Version"
+	}
+	max_version {
+	    label "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 "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/lorsm/www/md/technicalmd/technical_size.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/technicalmd/Attic/technical_size.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/technicalmd/technical_size.adp	14 Nov 2004 12:50:17 -0000	1.1
@@ -0,0 +1,29 @@
+<master>
+<property name="title">@title;noquote@</property>
+<property name="context">@context;noquote@</property>
+
+<include src="../form-md-record/md-record"
+    ims_md_id="@ims_md_id;noquote@"
+/>
+
+<hr>
+
+<h3>Technical Metadata Size</h3>
+<blockquote>
+  <table cellspacing="2" cellpadding="2" border="0" width="50%">
+    <tr class="form-section">
+      <th colspan="2">Technical Metadata</th>
+    </tr>
+    <tr class="form-section">
+      <td class="form-section">Size: </td>
+      <td><listtemplate name= "d_te_size"></listtemplate></td>
+    </tr>   
+
+  </table>
+</blockquote>
+<p>
+
+<h3>Add/Edit Technical Metadata Size</h3>
+<blockquote>
+ <formtemplate id="technicalmd_size" style="standard-lars"></formtemplate>
+</blockquote>
Index: openacs-4/packages/lorsm/www/md/technicalmd/technical_size.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/technicalmd/Attic/technical_size.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/lorsm/www/md/technicalmd/technical_size.tcl	14 Nov 2004 12:50:17 -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 2004/11/14 12:50:17 ernieg Exp $
+
+} {
+    ims_md_id:integer
+} -properties {
+} -validate {
+} -errors {
+}
+
+# set context & title
+set context [list [list [export_vars -base ".." ims_md_id] "IMS Metadata Editor"]  [list [export_vars -base "../technicalmd" \im\s_md_id] "Technical MD"] "Edit Size"]
+set title "Add/Edit Technical MD Size"
+
+# Form
+
+ad_form -name technicalmd_size \
+    -cancel_url ../technicalmd?ims_md_id=$ims_md_id \
+    -mode edit \
+    -form {
+
+    {t_size:text,nospell
+	{section "Add/Edit Technical MD Size"}
+        {html {size 30}}
+	{help_text "Size of the resource (in bytes)"}
+        {label "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 "No Size Available" \
+    -html { align right style "width: 100%;" } \
+    -elements {
+        t_size_bytes {
+            label "Size"
+        }
+        export {
+            display_eval {\[Edit\]}
+            link_url_eval { [export_vars -base "technical_size" {ims_md_id}] }
+            link_html {title "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
+}