<html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>1.&nbsp;Data Model:</title><link rel="stylesheet" href="html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.67.0"><link rel="start" href="index.html" title="dotlrn-Catalog Documentation"><link rel="up" href="ch01.html" title="Chapter&nbsp;1.&nbsp;DESIGN"><link rel="prev" href="ch01.html" title="Chapter&nbsp;1.&nbsp;DESIGN"><link rel="next" href="ch01s02.html" title="2.&nbsp;Content Folder"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">1.&nbsp;Data Model:</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter&nbsp;1.&nbsp;DESIGN</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch01s02.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e9"></a>1.&nbsp;Data Model:</h2></div></div></div><p>The basic table that has all the information about dotlrn-catalog courses is:</p><div class="screenshot"><div class="mediaobject"><img src="resources/dcat_table.JPG" alt="image showing dotlrn_catalog table"></div></div><p>I</p><p>Indexes: "dotlrn_catalog_pkey" primary key, btree (course_id) Foreign-key constraints: "$1" FOREIGN KEY (course_id) REFERENCES cr_revisions(revision_id)</p><p>The new content_type and attribute table are created with the after-install apm-callback-proc as follows:</p><p></p><pre>content::type::new -content_type "dotlrn_catalog" \
 -pretty_name "DotLRN Catalog" \
 -pretty_plural "DotLRN Catalog" \
 -table_name "dotlrn_catalog" \
 -id_column "course_id"</pre><p>now set up the attributes that by default we need for the course</p><pre> content::type::attribute::new \
 -content_type "dotlrn_catalog" \
 -attribute_name "course_key" \
 -datatype "string" \
 -pretty_name "Course Key" \
 -pretty_plural "Course Key" \
 -sort_order 1 \
 -column_spec "varchar(50)"</p><p>content::type::attribute::new \
 -content_type "dotlrn_catalog" \
 -attribute_name "course_name" \
 -datatype "string" \
 -pretty_name "Course Name" \
 -sort_order 2 \
 -column_spec "varchar(200)"</p><p>content::type::attribute::new \
 -content_type "dotlrn_catalog" \
 -attribute_name "course_info" \
 -datatype "text" \
 -pretty_name "Course Information" \
 -sort_order 3 \
 -column_spec "text"</p><p>content::type::attribute::new \
 -content_type "dotlrn_catalog" \
 -attribute_name "assessment_id" \
 -datatype "integer" \
 -pretty_name "Assessment ID" \
 -sort_order 4 \
 -column_spec "integer"</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ch01.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ch01s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;1.&nbsp;DESIGN&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;2.&nbsp;Content Folder</td></tr></table></div></body></html>