Metadata_for_Dokeos.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>Metadata for Dokeos</title>
  5. <meta http-equiv="content-type"
  6. content="text/html; charset=ISO-8859-1">
  7. <style>
  8. .code {font-family: Courier New, Courier, monospace; font-size: x-small}
  9. </style>
  10. </head>
  11. <body style="color: rgb(0, 0, 0); background-color: rgb(255, 204, 153);"
  12. alink="#000099" link="#000099" vlink="#990099">
  13. <font face="Helvetica, Arial, sans-serif">
  14. <h1>Metadata for Dokeos 1.6</h1>
  15. <div align="right">document version:2005/09/20.<br>
  16. </div>
  17. <br>
  18. This is a short technical documentation about the metadata (MD)
  19. implementation in Dokeos 1.6. The 1.6 implementation (DMD1.6) mainly
  20. consists of:<br>
  21. <ul>
  22. <li>screens and scripts for document-MD viewing and editing;</li>
  23. <li>two XML-related libraries;</li>
  24. <li>a general MD toolkit with some API functions;</li>
  25. <li>experimental scripts for search via MD and for getting statistics
  26. on keyword usage;</li>
  27. <li>not fully supported scripts for indexing and searching MD with
  28. PhpDig;<br>
  29. </li>
  30. <li>not fully supported scripts for storing/editing MD related to
  31. Links;<br>
  32. </li>
  33. <li>not fully supported scripts for SCORM package metadata import
  34. and custom browsing (see end of document).</li>
  35. </ul>
  36. Background information can be found on&nbsp;<a
  37. href="http://zephyr.ugent.be/courses/TW05DBRH/">Zephyr</a>:
  38. VeloMetadataClaroline.doc (via Documenten, Metadata). (That document
  39. is, however, outdated where it
  40. describes the implementation.)<br>
  41. <br>
  42. <h2>Metadata, XML, MD table</h2>
  43. MD is XML-formatted information about a Dokeos object. It is stored in
  44. a course database table (not globally), and Dokeos objects are
  45. identified in that table by their type + '.' + id. For example,
  46. 'Document.12'
  47. refers to an object
  48. of type 'Document' (a file or a folder in the Dokeos Documents tool).<br>
  49. <br>
  50. The design of DMD1.6 allows to define, per type of object, which info
  51. is to be stored as MD, and how the MD is represented in XML. Both can
  52. be
  53. adapted relatively easily, in a PHP-script that defines the object
  54. class
  55. 'mdobject' for the object type at hand.<br>
  56. <br>
  57. DMD1.6 fully implements MD definition, storage and editing for
  58. 'Document'-type
  59. objects. The class 'mdobject' for these type of objects is defined in
  60. the script 'md_document.php'. The class definition includes a method
  61. to generate the default MD for new entries. (The scripts 'md_link.php'
  62. and 'md_scorm.php' define the class 'mdobject' for 'Link'- and
  63. 'Scorm'-type objects. Script 'md_mix.php' defines a subset of the
  64. 'mdobject' class functionality for the experimental Search script.)<br>
  65. <br>
  66. DMD1.6 works with standard IEEE LOM (Learning Objects MD). The
  67. XML-representation
  68. conforms to SCORM 1.3 (also known as SCORM 2004). The IEEE LOM elements
  69. General.Identifier.Catalog
  70. and .Entry are made to contain a globally unique object identifier of
  71. the
  72. form urn:institution:platform.coursecode.type.id and for element
  73. Technical.Location an URL is generated that points to script
  74. 'openobject.php', also part of DMD1.6.<br>
  75. <br>
  76. To make changes to type and representation of MD more easy, the
  77. 'mdobject' class also defines a map for the (generally accepted) Dublin
  78. Core elements. A specific Dokeos installation can thereby adapt
  79. DMD1.6 relatively easily e.g. to use SCORM 1.2 and/or IMS-XML instead
  80. of SCORM 2004.<br>
  81. <br>
  82. MD is stored in the (new) course database table 'metadata'. Count on
  83. 2-4 KB per metadata record.<br>
  84. <br>
  85. The MD records currently have 5 fields: eid (entry-id or object
  86. identifier),
  87. mdxmltext (metadata text, XML-formatted), md5, htmlcache1, htmlcache2,
  88. indexabletext. The latter three fields are used for cached HTML and for
  89. storing text to be indexed for search; the hash-value md5 is used to
  90. validate
  91. the cache.<br>
  92. <br>
  93. The script
  94. 'md_funcs', part of the MD toolkit, and used a.o. in the index and
  95. search
  96. scripts, contains a class definition 'mdstore', which handles all
  97. database operations. Code
  98. that is shared by several other scripts is also to be found in
  99. 'md_funcs.php': common functions, code related to IEEE, and code
  100. related
  101. to the keyword tree (see below).<br>
  102. <br>
  103. <h2>XMD and XHT</h2>
  104. Two new libraries in inc/lib are essential for DMD1.6: the XML Mini-DOM
  105. 'xmd' and XML HTML Templates 'xht'. The corresponding scripts contain
  106. some comments describing their functionality. Test scripts are included
  107. in DMD1.6
  108. to demonstrate the use of these libraries.<br>
  109. <br>
  110. DOM XML functions are also available in PHP 4 itself, but they are
  111. experimental. They require an extra
  112. nonstandard XML library and, on Windows, fiddling with DLLs. To avoid
  113. these problems, DMD1.6 comes with its own XML Mini-DOM library.<br>
  114. <br>
  115. Several open source template libraries exist for PHP, and yet DMD1.6
  116. again comes with its own one. The main design goal for the XML HTML
  117. Templates library is
  118. to combine HTML separation and a tight connection with an XML
  119. (mini-dom-)document. These
  120. are essential, given the goal of flexibility concerning kind and
  121. representation of MD and presentation to the user. The 'xht' library
  122. is mainly used to generate HTML, but DMD1.6 also uses it to generate
  123. XML
  124. (e.g. the default XML for new MD records in 'md_document.php') and
  125. JavaScript (in 'md_funcs.php').<br>
  126. <br>
  127. If it is decided for a future version of Dokeos to use a more
  128. 'standard'
  129. approach for XML and/or for templates (e.g. Smarty), then DMD will
  130. most
  131. probably be adapted.<br>
  132. <br>
  133. The use of 'xht' in DMD1.6 allows to define, per type of object,
  134. what part of the MD is to be shown to a Dokeos user or presented for
  135. editing, and how
  136. that info is rendered as HTML (between the page header and footer).
  137. For 'Document'-type objects, the HTML templates for MD viewing and
  138. editing are to be found in 'md_document.htt'. (Compare them with the
  139. templates in 'md_link.htt', 'md_scorm.htt' (both not fully supported),
  140. and 'mds_mix.htt'., the
  141. templates used when rendering the (experimental)
  142. search screen.)<br>
  143. <br>
  144. Some little notes here will come in handy for easier understanding of
  145. the templates. For more info, look into the
  146. source code of the libraries.<br>
  147. <ul>
  148. <small> <li>A&nbsp;template starts with a special comment line
  149. giving the
  150. template name. A template ends where the next one starts.<br>
  151. </li>
  152. <li>Templates can call other templates, example "<span class="code">{-C
  153. LANGSELECT-}</span>" (a "call" construct).</li>
  154. <li>Calls do not have parameters. Instead, there is a global
  155. parameter array. String values are stored in it with the "define
  156. construct", e.g. "<span class="code">{-D label Language-}</span>"
  157. (define "label" to have the value "Language"). Parameter values are
  158. fetched with the "parameter" construct, e.g. "<span class="code">{-P
  159. title-}</span>".&nbsp;</li>
  160. <li>Some parameters are predefined, e.g. "<span class="code">{-P 0-}</span>"
  161. ('0'), "<span class="code">{-P 1-}</span>", "<span class="code">{-P
  162. empty-}</span>" (empty string). When another literal values needs to be
  163. used in a construct, put it in a parameter, e.g. "<span class="code">{-D
  164. XML application/xml;iso-8859-1-}</span>" </li>
  165. <li>The "language" construct "<span class="code">{-L KwHelp-}</span>"
  166. includes the value of a language variable from a Dokeos language file
  167. (here: $langKwHelp). (To be correct, it calls the function that has
  168. been assigned to xht_get_lang, usually get_lang.)<br>
  169. </li>
  170. <li>The "XML construct", e.g. "<span class="code">{-X
  171. technical/format-}</span>" fetches a value from the associated XML
  172. document (in DMD1.6 most often the metadata of a Dokeos object).</li>
  173. <li>The "test construct", e.g. "<span class="code">{-T key ==
  174. selvalue selected-}</span>" provides conditional inclusion. Our
  175. example: include
  176. the word "selected" only when parameter "key" is equal to parameter
  177. "selvalue".</li>
  178. <li>Constructs can span several lines, but special care is required
  179. for correct spacing. See examples with the test construct in
  180. 'md_document.htt': the space at the end of an unclosed "<span
  181. class="code">{-T ...</span>" line is essential!</li>
  182. <li>The "repeat construct", e.g. "<span class="code">{-R Langs C
  183. OPTION-}</span>" repeatedly calls a subtemplate. In this example, the
  184. subtemplate "OPTION" is repeated for all values in the associative list
  185. $langLangs. (Sample associative lists can be found in <span
  186. class="code">lang/english/md_document.inc.php</span>
  187. Another example: "<span class="code">{-R general/keyword C
  188. KEYWORD-}</span>" - repeat "KEYWORD" for all XML elements found by the
  189. given path "general/keyword".</li>
  190. <li>Constructs can be nested such as in e.g. "<span class="code">{-H
  191. {-L {-P label-}Tip-}-}</span>". </li>
  192. <li>The "X" construct implicitly includes the htmlspecialchars
  193. transformation. Where this is not desired, the "V" ("value") construct
  194. can be used instead. ("X" = "V" + "H") To refer to the associated XML
  195. document, both constructs use an XPath parameter such as
  196. 'general/title/string/@language'. There is a provision in 'xht'
  197. allowing to include the callback marker '=/' in XPaths (see source
  198. code).<br>
  199. </li>
  200. <li>As a convenience, the C, L, P, V, and X constructs allow
  201. cascading instead of nesting, e.g. "<span class="code">{-V P xpath-}</span>"
  202. is equivalent to "<span class="code">{-V {-P xpath-}-}</span>". </li>
  203. <li>For the "E" construct, see "Caching".<br>
  204. </li>
  205. <li>It should be kept in mind that template scanning and substitution
  206. is simple character-processing. To help with template definition and
  207. adaptation, 'xht' can generate tracing information that can be
  208. made visible in the HTML page source (see xht_dbgn and xht_dbgo).</li>
  209. </small>
  210. </ul>
  211. <br>
  212. <h2>Mime types and Technical.Format</h2>
  213. In the IEEE LOM standard, the metadata element Technical.Format must
  214. contain the learning object mime type. DMD1.6 uses
  215. DocumentManager::file_get_mime_type as authorative source for mime
  216. types and for determining the default mime type based on file extension.<br>
  217. <br>
  218. There is a provision for adding mime types that are not listed in
  219. DocumentManager::file_get_mime_type,
  220. for example alternative mime types for a specific file extension. This
  221. is done via the language variable $langFormats (see DLTT and Dokeos
  222. lang-file md_document). This language variable must contain an
  223. associative list such as e.g. "<span class="code">:text/plain;iso-8859-1:Text;Latin-1,,
  224. application/xml;iso-8859-1:Xml;Latin-1</span>". (The second part of a
  225. list
  226. item, e.g. "<span class="code">Text;Latin-1</span>", appears in the
  227. selection box in the metadata
  228. screen and can be made language-specific.) (In associative lists,
  229. elements are separated by double comma; value and language text are
  230. separated by the first character in the language string, here a colon.)<br>
  231. <br>
  232. One specific mime type can be designated as the mime type for course
  233. keywords documents (see next section). This is done by defining
  234. parameter XML in the template file metadata/md_document.htt. In DMD1.6
  235. it contains:<br>
  236. <span class="code">{-D XML application/xml;iso-8859-1-}</span><br>
  237. <br>
  238. <h2>Keywords in a tree, JavaScript<br>
  239. </h2>
  240. MD usually includes
  241. keywords, and there is a special provision in
  242. DMD1.6 allowing to (optionally) define a structured set of keywords for
  243. each course. The course manager defines the keywords in an xml file (an
  244. example is provided) and uploads it to the course documents area. When
  245. browsing to that document's metadata, there will be a button 'This
  246. document contains the course keywords'. The
  247. XML-structured keywordtree is then converted to the cache file
  248. 'CourseKwds.js'
  249. in the course's top-level directory. The button must be used after each
  250. change to the xml file. To remove all course keywords (and the cache
  251. file), use the button on an xml file containing only spaces or only a
  252. top element with no content.<br>
  253. <br>
  254. The cache file constructs a clickable tree
  255. in HTML (restricted to W3C browsers). The toolkit script 'md_funcs'
  256. contains the server-side functions related to the keyword tree, the
  257. file 'md_script.js' contains
  258. the client-side script.<br>
  259. &nbsp; <br>
  260. Whether the keyword tree is
  261. presented in a screen (index, search, ...), and if so, where and how,
  262. can again be defined relatively easily via the templates. The MD
  263. view-and-edit screen also converts comma-separated keywords (whether
  264. selected with the clickable tree or typed in)
  265. to separate XML elements (as required by SCORM 1.3).<br>
  266. <br>
  267. The file 'md_script.js' also contains the client-side script used by
  268. the HTML templates in 'md_document.htt' for input validation and MD
  269. update preparation in screens for 'Document'-type object MD. Whereas
  270. keyword-tree clicking requires a W3C browser, input validation and MD
  271. update should also work with IE4 and NS4 browsers (not tested).<br>
  272. <br>
  273. DMD1.6 contains input validation of two kinds (put the following on the
  274. HTML INPUT element):<br>
  275. <ul>
  276. <li><span class="code">onKeyPress="return
  277. isValidChar(event, pattern, flags)"</span>, e.g. '[a-z]', 'i': allow
  278. only the
  279. 26*2 letters: all other input is disabled in the INPUT field; examples
  280. in the fields for the learning object identifier and for keywords;</li>
  281. <li><span class="code">onKeyUp="checkValid(this,
  282. pattern, flags)"</span>, e.g. '^[a-z]{2,8}$', 'i': field must contain
  283. between 2
  284. and 8 letters: nonconforming input will pass, but text is rendered in
  285. red to alert the user; an example in the date field (lng. obj.
  286. creation).</li>
  287. </ul>
  288. To provide a minimum level of MD editing support when there is no
  289. scripting in the browser, the templates in 'md_editxml' allow direct
  290. editing of the XML formatted data. (This same template is used should
  291. an XML syntax error be detected, thereby allowing to repair XML
  292. metadata.)<br>
  293. <br>
  294. To view the XML formatted data, click the 'Store' button while holding
  295. CTRL- and ALT-keys down.<br>
  296. <br>
  297. The server-side functions for the construction of the keyword tree
  298. cache file (in 'md_funcs')
  299. mimic an XSLT process which is
  300. documented in 'SelKwds.xsl'. (This file, and XSLT in general, is not
  301. used in DMD1.6.)<br>
  302. <br>
  303. The experimental script 'statistics.php' gives statistics about the
  304. usage of course keywords. It is not linked to any Dokeos
  305. 1.6 screen, therefore not reachable in a standard installation.<br>
  306. <br>
  307. <h2>MD toolkit and API<br>
  308. </h2>
  309. The script 'md_funcs' contains the main part of the toolkit and API.
  310. They allow other Dokeos scripts to define, modify and delete MD for
  311. specific objects (see class 'mdstore'). The script 'md_funcs' must be
  312. combined with a script
  313. that defines the object class 'mdobject' for the specific type of
  314. object
  315. (such as&nbsp; 'md_document.php' for 'Document'-type objects). The test
  316. scripts 'dcex' and 'mdApiTest' demonstrate the toolkit and the API
  317. functions.<br>
  318. <br>
  319. The simplest way of working with the API is by using the functions
  320. 'mds_get_dc_elements' and 'mds_put_dc_elements'. They allow to fetch
  321. and store the MD elements that are part of the so called Dublin Core.
  322. The DC elements form a generally accepted core set of metadata.<br>
  323. <br>
  324. The function 'mds_update_xml_and_mdt' is particularly useful for
  325. translating user interactions with a MD edit screen to MD-store
  326. operations. When using the API, it might be more handy to work with xmd
  327. and mdstore operations directly.<br>
  328. <br>
  329. A word of warning: MD scanning is a relatively compute-intensive task.
  330. If used in a loop, e.g. to display some specific info about several
  331. hundreds of documents, server response might slow down.<br>
  332. <br>
  333. <h2>Other files in DMD1.6</h2>
  334. Language files
  335. 'md_document.inc.php' are available for English, French and Dutch.
  336. Language files 'md_link.inc.php' and 'md_scorm.inc.php' only exist in
  337. English.<br>
  338. <br>
  339. Files 'md_link.php' and 'md_link.htt', also 'md_scorm.php' and
  340. 'md_scorm.htt', all already mentioned, are used in
  341. conjunction with the not fully supported functionality related to Link
  342. metadata
  343. and SCORM
  344. package metadata import.<br>
  345. <br>
  346. File 'md_link.php', in conjunction with 'index.php', demonstrates the
  347. use of the mdo_override and mdo_storeback methods allowing to implement
  348. a more tight synchronization between MD and standard Dokeos object
  349. properties than is actually implemented for document MD (see also
  350. below: Link metadata editing).<br>
  351. <br>
  352. <h2>Caching</h2>
  353. The 'xht' library provides caching functions, which allow to speed up
  354. screen building. DMD1.6 caches information to database fields
  355. 'htmlcache1' and 'indexabletext' ('htmlcache2' is not used in DMD1.6).<br>
  356. <br>
  357. In 'md_document.htt' it can be seen that the MD view-and-edit screen
  358. (produced by index.php) is divided in four main parts: part 1, the
  359. keywords tree,
  360. part 2 and the POST form.<br>
  361. <br>
  362. Instead of a normal "call" from a template to a subtemplate, which
  363. would be "<span class="code">{-C METADATA_PART1-}</span>", the main
  364. template does an "escape-call" "<span class="code">{-E
  365. md_part1 C METADATA_PART1-}</span>". The escape construct works as
  366. follows: the
  367. 'xht' library does a callback to the user code, in this example to the
  368. PHP
  369. function 'md_part1'. The code for that function can be found in
  370. 'index.php'.
  371. That function checks whether it has a valid cached HTML and if so,
  372. returns
  373. it, thereby avoiding the template expansion of the subtemplate
  374. METADATA_PART1.
  375. If not, 'xht' effectively does the (supposedly slow) expansion and
  376. allows
  377. the callback function 'md_part1' to store it for re-use.<br>
  378. <br>
  379. In DMD1.6, "part 1" of the screen contains most template expansion
  380. work, hence the database field 'htmlcache1' is a real HTML cache.
  381. Another part of the screen is made to contain the "words" from the
  382. metadata that must
  383. be indexable and searchable. It corresponds with the database
  384. field 'indexabletext'.<br>
  385. <br>
  386. Under certain circumstances, caching may cause a delay after a change.
  387. For example, when making languages visible or unvisible, they may not
  388. immediately appear in or disappear from the SELECT inputfields in
  389. existing metadata. To make the change visible, edit that metadata.<br>
  390. <br>
  391. Toolkit/API functions such as
  392. 'mds_append', useful e.g. for adding searchable words to
  393. 'indexabletext', must be used with care, because of possible
  394. interactions with the index
  395. script, when it allows users to modify metadata (and therefore also
  396. indexable words) interactively.<br>
  397. <br>
  398. <h2>Index and Search scripts<br>
  399. </h2>
  400. Both scripts lean heavily on the libraries and on the API;
  401. they are therefore relatively short.<br>
  402. <br>
  403. Note that all output is produced in a section at the end of the scripts.<br>
  404. <br>
  405. DMD1.6 has an experimental screen for searching documents based on
  406. their MD. It is not linked to any Dokeos
  407. 1.6 screen, therefore not reachable in a standard installation.<br>
  408. <br>
  409. This MD search screen described in this section does not require the
  410. installation of PhpDig 1.8.6. as opposed to the (not fully supported)
  411. PhpDig indexing/searching scripts described further down.<br>
  412. <br>
  413. A general search in all metadata is not so easy,
  414. because the metadata can in theory be quite different for different
  415. types of
  416. Dokeos objects. In practice, Dokeos platforms will probably stick to
  417. identical or rather similar metadata for all objects and might
  418. therefore find the search script useful.<br>
  419. <br>
  420. The DMD1.6 MD search script does an unsophisticated database query in
  421. field 'indexabletext', supposedly containing all searchable words.<br>
  422. <br>
  423. DMD1.6 puts these searchable words in the field:
  424. <ul>
  425. <li>via function md_indexabletext in index.php if that function is
  426. called from the templates in a "E" construct (see Caching); this is the
  427. case for Document;</li>
  428. <li>for Scorm and Link: via function mdo_define_htt in md_scorm.php
  429. and md_link.php, called by
  430. importmanifest.php and importlinks.php.</li>
  431. </ul>
  432. Note that keywords are transformed, e.g. MD keyword 'fish' will become
  433. searchable word 'fish-kw'. This allows search to focus on the keyword,
  434. without finding references where the word 'fish' is part of some
  435. description. This can of course (because of the templates) be changed
  436. relatively easily, but it should be noted that the current search
  437. screen &amp; script, and also the PhpDig connection, assume this
  438. transformation.<br>
  439. <br>
  440. The script
  441. 'update_indexabletext.php' can be used to update MD records when the
  442. definition of the searchable words is changed. It is not linked to any Dokeos
  443. 1.6 screen, therefore not reachable in a standard installation. It uses
  444. function mdo_define_htt already mentioned above. For documents,
  445. md_document.php should then contain the same definition as the one in
  446. md_document.htt. Use the script with e.g. '?eid_type=Document'.<br>
  447. The SCORM package metadata import script importmanifest.php (see
  448. below), if used with SCORM
  449. 2004 packages, generates metadata records (type 'Scorm') that are very
  450. similar to the 'Document' type metadata records.<br>
  451. <br>
  452. Before generating output, search combines (in memory) the XML metadata
  453. of all
  454. Dokeos objects that it has found for a particular query into a big,
  455. imsmanifest-like XML document. It is expected that this will cause
  456. problems if many hundreds or thousands of objects have metadata and can
  457. therefore be "found" in one query.<br>
  458. <br>
  459. All of this shows that the search script will need to evolve in future
  460. Dokeos versions.<br>
  461. <br>
  462. To make metadata search available on your Dokeos server, include a link
  463. to <br>
  464. <span class="code">.../metadata/search.php?type=Mix
  465. </span><br>
  466. <br>
  467. <h2>DMD1.6 files with comments</h2>
  468. <h3>Updates for standard Dokeos scripts</h3>
  469. <h4>document/edit_document.php</h4>
  470. The (one and only) link between Dokeos and metadata (via Documents).<br>
  471. <h4>lang/*/document.inc.php</h4>
  472. Two additional language-dependent words for edit_document.<br>
  473. <h4>inc/lib/fileManage.lib.php</h4>
  474. Updated to delete the metadata entry when deleting a document or a
  475. SCORM folder. (Link-MD is not automatically deleted.)<br>
  476. <br>
  477. <h2>Functionality not fully
  478. supported in DMD1.6</h2>
  479. <h3>Link metadata editing</h3>
  480. To allow course managers to interactively store and edit metadata about
  481. a Link, provide an URL such as:<br>
  482. <span class="code">.../metadata/?eid=Link.nnn</span><br>
  483. <br>
  484. This metadata may e.g. add keywords.<br>
  485. <br>
  486. Unlike with Document-type objects, Link-type metadata object editing
  487. has an override- and storeback-functionality. When metadata is
  488. displayed for editing, DB data is overridden by new data from the Links
  489. table (but not automatically stored): category, url, title,
  490. description, keywords. When metadata is changed in the MD edit screen
  491. and stored, then new data is stored back into the Links table: url,
  492. title, description, keywords (but not category).<br>
  493. <br>
  494. In the Links table, MD description and keywords are combined in the
  495. description field, as follows:<br>
  496. <span class="code">&lt;i kw="kw1, kw2, ..."&gt;Description&lt;/i&gt;</span><br>
  497. Thereby keywords are not visible to the user, yet editable by the
  498. course admin.<br>
  499. <h4>importlinks.php</h4>
  500. This script, not reachable
  501. until you e.g. link it to a course homepage,
  502. performs the following operations
  503. related to Links:<br>
  504. <ul>
  505. <li>Create MTEs (Metadata
  506. Table Entries) for all Links of a specific category</li>
  507. <li>Delete all MTEs for
  508. Links of a specific category</li>
  509. <li>Index all MTEs of a
  510. Link category for search (see also below, PhpDig connection)</li>
  511. </ul>
  512. As importlinks is meant to be used only by course admins, hide
  513. it after you have linked it to the course homepage.<br>
  514. <br>
  515. <h3>SCORM metadata import and custom browsing</h3>
  516. <h4>importmanifest.php</h4>
  517. This script, not reachable until you e.g. link it to a course homepage,
  518. performs the following operations
  519. related to Metadata Table Entries (MTEs) and SCORM package directories
  520. (SPDs) in Learning Path (which have a SCORM Directory Id SDI):
  521. <ul>
  522. <li>Import or re-import the 'imsmanifest.xml' file from a SPD into
  523. MTEs</li>
  524. <li>Find the SDI of some SPD</li>
  525. <li>Delete all MTEs corresponding to a specific SDI</li>
  526. <li>Show the main MTE corresponding to some SDI (after import)</li>
  527. <li>Start 'index.php' in some SPD (after import)<br>
  528. </li>
  529. <li>Index some SPD for search (see also below, PhpDig connection)<br>
  530. </li>
  531. </ul>
  532. Note that the above mentioned 'index.php' in the SPD is created by
  533. import.<br>
  534. <br>
  535. As importmanifest is meant to be used only by course admins, hide
  536. it after you have linked it to the course homepage.<br>
  537. <h4>playscormmdset.inc.php</h4>
  538. This include-script contains the main functionality of the custom
  539. browser.<br>
  540. <br>
  541. Import creates an 'index.php' in the corresponding scorm folder of a
  542. course. It includes 'playscormmdset'.<br>
  543. <br>
  544. (Thereby to a search engine, the custom browser will appear as if it is
  545. located in that scorm folder. This is important for search engines that
  546. allow to index/re-index by virtual directory.)<br>
  547. <br>
  548. The custom browser uses a templates file to generate HTML, but unlike
  549. the standard MD screens, it looks for that templates file in the scorm
  550. folder or in its parent folders. Thereby the generated HTML can be
  551. different for different scorm folders.
  552. <br>
  553. An example templates file can be found in metadata/doc/mdp_scorm.htt.<br>
  554. <br>
  555. <br>
  556. <h3>PhpDig connection</h3>
  557. DMD1.6 includes functionality
  558. allowing a specific course to work with a customized version of PhpDig
  559. 1.8.6 that has been built into the course. This provides quicker and
  560. more
  561. sophisticated search functionality.<br>
  562. <br>
  563. The connection consists of the script 'md_phpdig.php', this document
  564. section, and the customized files in ...main/metadata/phpdig.<br>
  565. <br>
  566. It is assumed that a system admin installs a copy of PhpDig in a
  567. subfolder 'phpdig-1.8.6' of the course webfolder, customizes it as
  568. described below and by the sample files, and initializes it by running
  569. PhpDig's install script.<br>
  570. <br>
  571. The admin screen of PhpDig can best be defined as a hidden
  572. link (because course-admin only) in the course homepage. A link in a
  573. separate window is best, as the admin screen has no Dokeos header.<br>
  574. <br>
  575. Script 'md_phpdig.php' contains a few lines copied from the PhpDig
  576. config script and a set of functions that can be used as API functions
  577. providing a PhpDig DB-feeder mechanism. They allow combinations of URLs
  578. and searchable words to be fed into the DB directly, bypassing the
  579. PhpDig spider script. The API code is PhpDig spider code, covered by
  580. the GNU GPL just like PhpDig is.<br>
  581. <br>
  582. Scripts 'importdocs.php', 'importlinks.php' and
  583. 'importmanifest.php' make use of that API to index MD for PhpDig. None
  584. of them are reachable from standard Dokeos 1.6 screens.<br>
  585. <br>
  586. The PhpDig Search screen, which can be used instead of the experimental
  587. MD search screen, is the custom 'search.php' available in the
  588. metadata/phpdig folder. It must be copied to the 'phpdig-1.8.6'
  589. subfolder of the
  590. course webfolder and then made reachable from the course homepage.<br>
  591. <br>
  592. PhpDig by default combines search terms with AND and searches for words
  593. starting with the search term strings. Negation is done by putting a
  594. hyphen before the search term (implemented as ALT-click in the search
  595. screen keyword tree).<br>
  596. <br>
  597. Some background information can be found on&nbsp;<a
  598. href="http://zephyr.ugent.be/courses/TW05DBRH/">Zephyr</a>:
  599. VeloMetadataClaroline.doc (via Documenten, Leerobjectbouwstenen,
  600. Exploreerbare leerstof: document SearchableImageWebsite).<br>
  601. <h4>PhpDig 1.8.6 customizations overview</h4>
  602. <h5>includes/config</h5>
  603. <ul>
  604. <span class="code"> <li>define('PHPDIG_ADM_PASS','admin');
  605. // insert a password</li>
  606. <li>$template =
  607. "array";</li>
  608. <li>define('MAX_WORDS_SIZE',50);</li>
  609. <li>define('SUMMARY_DISPLAY_LENGTH',700);</li>
  610. <li>define('CONTENT_TEXT',0);</li>
  611. <li>define('USE_IS_EXECUTABLE_COMMAND','0');</li>
  612. </span>
  613. </ul>
  614. <h5>libs/phpdig_functions<br>
  615. </h5>
  616. <span class="code">' \'._~@#$:&amp;%/;,=-]+'</span>
  617. replaced (twice) by<br>
  618. <span class="code">' \'._~@#$&amp;%/=-]+' no :;, in words</span><br>
  619. <h5>search.php</h5>
  620. This is the script that must be made accessible in the course, to
  621. provide PhpDig search. It is a newly developed script replacing
  622. PhpDig's standard one.<br>
  623. <br>
  624. Course managers can adapt the search form and provide extra search
  625. criteria as explained in the SearchableImageWebsite document mentioned
  626. above.<br>
  627. <h5>libs/search_function</h5>
  628. <span class="code">" \'.\_~@#$:&amp;\%/;,=-]+"</span>
  629. replaced by<br>
  630. <span class="code">" \'._~@#$&amp;%/=-]+" no \:;, in words<br>
  631. <br>
  632. two special "words" are used for controlling the displaying of the
  633. search results: "txt-sep" (newline) and "txt-end" (end of display)<br>
  634. <br>
  635. the "-kw" tail of keywords is stripped off in the search results</span><br>
  636. <h5>thumbnail support</h5>
  637. This is quite well explained in the above mentioned background material.<br>
  638. <br>
  639. This works only with special-design SCORM packages: item resource
  640. file[1]/@href is assumed to point to the thumbnail image, which must
  641. have a filename 'pptsl' + nnn + '_t.jpg' (see a.o.
  642. 'importmanifest.php').<br>
  643. <br>
  644. In md_phpdig.php, the '&amp;thumb=...' part of URLs is cut off for
  645. display.<br>
  646. <br>
  647. Metadata search also displays the thumbs (see
  648. '.../main/metadata/search.php' and 'mds_mix.htt').
  649. <br>
  650. </font>
  651. <br>
  652. </body>
  653. </html>