ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilContObjectManifestBuilder Class Reference

Content Object (ILIAS native learning module / digilib book) Manifest export class. More...

+ Collaboration diagram for ilContObjectManifestBuilder:

Public Member Functions

 ilContObjectManifestBuilder (&$a_cont_obj)
 Constructor public.
 buildManifest ()
 build manifest structure
 dump ($a_target_dir)
 dump manifest file into directory
 writeItemHierarchy ()
 write item hierarchy
 writeResources ()
 write resources

Data Fields

 $db
 $ilias
 $cont_obj
 $inst_id

Detailed Description

Content Object (ILIAS native learning module / digilib book) Manifest export class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilContObjectManifestBuilder.php 12658 2006-11-29 08:51:48Z akill

Definition at line 36 of file class.ilContObjectManifestBuilder.php.

Member Function Documentation

ilContObjectManifestBuilder::buildManifest ( )

build manifest structure

Definition at line 63 of file class.ilContObjectManifestBuilder.php.

References writeItemHierarchy(), writeResources(), and ilXmlWriter\xmlHeader().

{
require_once("classes/class.ilXmlWriter.php");
$this->writer = new ilXmlWriter;
// set xml header
$this->writer->xmlHeader();
// manifest start tag
$attrs = array();
$attrs["identifier"] = "il_".IL_INST_ID."_"."man".
"_".$this->cont_obj->getId();
$attrs["version"] = "";
$attrs["xmlns:xsi"] = "http://www.w3.org/2001/XMLSchema-instance";
$attrs["xsi:schemaLocation"] = "http://www.imsproject.org/xsd/imscp_rootv1p1p2".
" imscp_rootv1p1p2.xsd".
" http://www.imsglobal.org/xsd/imsmd_rootv1p2p1".
" imsmd_rootv1p2p1.xsd".
" http://www.adlnet.org/xsd/adlcp_rootv1p2".
" adlcp_rootv1p2.xsd";
$attrs["xmlns:imsmd"] = "http://www.imsproject.org/xsd/imsmd_rootv1p2p1";
$attrs["xmlns:adlcp"] = "http://www.adlnet.org/xsd/adlcp_rootv1p2";
$attrs["xmlns"] = "http://www.imsproject.org/xsd/imscp_rootv1p1p2";
$this->writer->xmlStartTag("manifest", $attrs);
// organizations start tag
$attrs = array();
$this->writer->xmlStartTag("organizations", $attrs);
// organization start tag
$attrs = array();
$attrs["identifier"] = "il_".IL_INST_ID."_".$this->cont_obj->getType().
"_".$this->cont_obj->getId();
$attrs["structure"] = "hierarchical";
$this->writer->xmlStartTag("organization", $attrs);
// title element
$attrs = array();
$this->writer->xmlElement("title", $attrs, $this->cont_obj->getTitle());
// write item hierarchy
// organization end tag
$this->writer->xmlEndTag("organization");
// organizations end tag
$this->writer->xmlEndTag("organizations");
// resources start tag
$attrs = array();
$this->writer->xmlStartTag("resources", $attrs);
// write resources
$this->writeResources();
// resources end tag
$this->writer->xmlEndTag("resources");
// manifest end tag
$this->writer->xmlEndTag("manifest");
// write manifest file
//$this->xml->xmlDumpFile($this->export_dir."/".$this->subdir."/".$this->filename
// , false);
// destroy writer object
$this->writer->_XmlWriter;
}

+ Here is the call graph for this function:

ilContObjectManifestBuilder::dump (   $a_target_dir)

dump manifest file into directory

Definition at line 137 of file class.ilContObjectManifestBuilder.php.

{
$this->writer->xmlDumpFile($a_target_dir."/imsmanifest.xml", false);
}
ilContObjectManifestBuilder::ilContObjectManifestBuilder ( $a_cont_obj)

Constructor public.

Definition at line 47 of file class.ilContObjectManifestBuilder.php.

References $ilias.

{
global $ilDB, $ilias;
$this->cont_obj =& $a_cont_obj;
$this->ilias =& $ilias;
$this->db =& $ilDB;
$this->inst_id = IL_INST_ID;
}
ilContObjectManifestBuilder::writeItemHierarchy ( )

write item hierarchy

this first version only writes one item for the whole learning module

Definition at line 147 of file class.ilContObjectManifestBuilder.php.

Referenced by buildManifest().

{
// start item
$attrs = array();
$attrs["identifier"] = "INDEX";
$attrs["identifierref"] = "RINDEX";
$this->writer->xmlStartTag("item", $attrs);
// title element
$attrs = array();
$this->writer->xmlElement("title", $attrs, $this->cont_obj->getTitle());
// end item
$this->writer->xmlEndTag("item");
}

+ Here is the caller graph for this function:

ilContObjectManifestBuilder::writeResources ( )

write resources

this first version only writes one resource for the whole learning module

Definition at line 169 of file class.ilContObjectManifestBuilder.php.

Referenced by buildManifest().

{
$attrs = array();
$attrs["identifier"] = "RINDEX";
$attrs["type"] = "webcontent";
$attrs["adlcp:scormtype"] = "asset";
$attrs["href"] = "res/index.html";
$this->writer->xmlElement("resource", $attrs, "");
}

+ Here is the caller graph for this function:

Field Documentation

ilContObjectManifestBuilder::$cont_obj

Definition at line 40 of file class.ilContObjectManifestBuilder.php.

ilContObjectManifestBuilder::$db

Definition at line 38 of file class.ilContObjectManifestBuilder.php.

ilContObjectManifestBuilder::$ilias

Definition at line 39 of file class.ilContObjectManifestBuilder.php.

Referenced by ilContObjectManifestBuilder().

ilContObjectManifestBuilder::$inst_id

Definition at line 41 of file class.ilContObjectManifestBuilder.php.


The documentation for this class was generated from the following file: