ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSCORM2004Chapter Class Reference

Class ilSCORM2004Chapter. More...

+ Inheritance diagram for ilSCORM2004Chapter:
+ Collaboration diagram for ilSCORM2004Chapter:

Public Member Functions

 ilSCORM2004Chapter ($a_slm_object, $a_id=0)
 Constructor public.
 delete ($a_delete_meta_data=true)
 Delete a chapter.
 copy ($a_target_slm)
 Copy chapter.
 exportXML (&$a_xml_writer, $a_inst, &$expLog)
 Export object to xml (see ilias_co.dtd)
 exportXMLMetaData (&$a_xml_writer)
 export structure objects meta data to xml (see ilias_co.dtd)
 _getPresentationTitle ($a_st_id, $a_include_numbers=false)
 get presentation title
 exportXMLPageObjects (&$a_xml_writer, $a_inst=0)
 export page objects of structure object (see ilias_co.dtd)
 exportXMLStructureObjects (&$a_xml_writer, $a_inst, &$expLog)
 export (sub)structure objects of structure object (see ilias_co.dtd)
 exportFOPageObjects (&$a_xml_writer)
 export object to fo
- Public Member Functions inherited from ilSCORM2004Node
 ilSCORM2004Node ($a_slm_object, $a_id=0)
 setTitle ($a_title)
 Set title.
 getTitle ()
 Get title.
 setDescription ($a_description)
 Set description.
 getDescription ()
 Get description.
 setType ($a_type)
 Set type.
 getType ()
 Get type.
 setSLMId ($a_slm_id)
 Set ID of parent Scorm Learning Module Object.
 getSLMId ()
 Get ID of parent Scorm Learning Module Object.
 setSLMObject ($a_slm_obj)
 Set Scorm Learning Module Object.
 getContentObject ()
 Get Scorm Learning Module Object.
 setId ($a_id)
 Set Node ID.
 getId ()
 Get Node ID.
 getImportId ()
 Set Import ID.
 setImportId ($a_id)
 Get Import ID.
 read ()
 Read Data of Node.
 MDUpdateListener ($a_element)
 Meta data update listener.
 createMetaData ()
 create meta data entry
 updateMetaData ()
 update meta data entry
 deleteMetaData ()
 delete meta data entry
 setDataRecord ($a_record)
 this method should only be called by class ilSCORM2004NodeFactory
 create ($a_upload=false)
 Create Node.
 update ()
 Update Node.
 delete ()
 Delete Node.
 _getIdForImportId ($a_import_id)
 Get Node ID for import ID (static)
 _exists ($a_id)
 Checks wether a node exists.
 _deleteAllSLMNodes ($a_slm_object)
 Delete all nodes of Scorm Learning Module.
 _lookupSLMID ($a_id)
 Lookup Scorm Learning Module ID for node id.
 clipboardCut ($a_slm_obj_id, $a_ids)
 Cut and copy a set of chapters/pages into the clipboard.
 insertChapterClip ($a_slm_obj, $a_as_sub=false)
 Insert Chapter from clipboard.
 getObjectives ()
 deleteSeqInfo ()
 parentHasSeqTemplate ()
 exportAsScorm12 ()
 exportAsScorm13 ()

Data Fields

 $tree
- Data Fields inherited from ilSCORM2004Node
 $slm_id
 $type
 $id
 $slm_object

Private Member Functions

 delete_rec ($a_delete_meta_data=true)
 Delete data records of chapter (and nested objects)

Additional Inherited Members

- Static Public Member Functions inherited from ilSCORM2004Node
static _lookupTitle ($a_obj_id)
 Lookup Title.
static _lookupType ($a_obj_id)
 Lookup Type.
static _writeTitle ($a_obj_id, $a_title)
 Write Title.
static _writeImportId ($a_id, $a_import_id)
 Write import ID.
static putInTree ($a_obj, $a_parent_id="", $a_target_node_id="")
 put this object into content object tree
static getTree ($a_slm_obj_id)
 Get scorm module editing tree.
static clipboardCopy ($a_slm_obj_id, $a_ids)
 Copy a set of chapters/pages/scos into the clipboard.
static uniqueTypesCheck ($a_items)
 Check for unique types (all pages or all chapters or all scos)
static insertPageClip ($a_slm_obj)
 Insert pages from clipboard.
static insertScoClip ($a_slm_obj)
 Insert scos from clipboard.
static pasteTree ($a_target_slm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false)
 Paste item (tree) from clipboard to current scorm learning module.

Detailed Description

Class ilSCORM2004Chapter.

Chapter class for SCORM 2004 Editing

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Member Function Documentation

ilSCORM2004Chapter::_getPresentationTitle (   $a_st_id,
  $a_include_numbers = false 
)

get presentation title

Definition at line 187 of file class.ilSCORM2004Chapter.php.

References $ilDB.

{
global $ilDB;
/*
// get chapter data
$query = "SELECT * FROM lm_data WHERE obj_id = ".$ilDB->quote($a_st_id);
$st_set = $ilDB->query($query);
$st_rec = $st_set->fetchRow(DB_FETCHMODE_ASSOC);
$tree = new ilTree($st_rec["lm_id"]);
$tree->setTableNames('lm_tree','lm_data');
$tree->setTreeTablePK("lm_id");
if ($a_include_numbers)
{
if ($tree->isInTree($st_rec["obj_id"]))
{
// get chapter tree node
$query = "SELECT * FROM lm_tree WHERE child = ".
$ilDB->quote($a_st_id)." AND lm_id = ".
$ilDB->quote($st_rec["lm_id"]);
$tree_set = $ilDB->query($query);
$tree_node = $tree_set->fetchRow(DB_FETCHMODE_ASSOC);
$depth = $tree_node["depth"];
$nr = $tree->getChildSequenceNumber($tree_node, "st")." ";
for ($i = $depth - 1; $i > 1; $i --)
{
// get next parent tree node
$query = "SELECT * FROM lm_tree WHERE child = ".
$ilDB->quote($tree_node["parent"])." AND lm_id = ".
$ilDB->quote($st_rec["lm_id"]);
$tree_set = $ilDB->query($query);
$tree_node = $tree_set->fetchRow(DB_FETCHMODE_ASSOC);
$seq = $tree->getChildSequenceNumber($tree_node, "st");
$nr = $seq.".".$nr;
}
}
}
return $nr.$st_rec["title"];
*/
}
ilSCORM2004Chapter::copy (   $a_target_slm)

Copy chapter.

Definition at line 90 of file class.ilSCORM2004Chapter.php.

References ilSCORM2004Node\getDescription(), ilSCORM2004Node\getId(), ilSCORM2004Node\getSLMId(), ilSCORM2004Node\getTitle(), ilSCORM2004Node\getType(), and ilSCORM2004Chapter().

{
$chap = new ilSCORM2004Chapter($a_target_slm);
$chap->setTitle($this->getTitle());
if ($this->getSLMId() != $a_target_slm->getId())
{
$chap->setImportId("il__chap_".$this->getId());
}
$chap->setSLMId($a_target_slm->getId());
$chap->setType($this->getType());
$chap->setDescription($this->getDescription());
$chap->create(true);
$a_copied_nodes[$this->getId()] = $chap->getId();
// copy meta data
include_once("Services/MetaData/classes/class.ilMD.php");
$md = new ilMD($this->getSLMId(), $this->getId(), $this->getType());
$new_md =& $md->cloneMD($a_target_slm->getId(), $chap->getId(), $this->getType());
return $chap;
}

+ Here is the call graph for this function:

ilSCORM2004Chapter::delete (   $a_delete_meta_data = true)

Delete a chapter.

Definition at line 53 of file class.ilSCORM2004Chapter.php.

References delete_rec(), ilSCORM2004Node\deleteSeqInfo(), and ilSCORM2004Node\getId().

{
$node_data = $this->tree->getNodeData($this->getId());
$this->delete_rec($a_delete_meta_data);
$this->tree->deleteTree($node_data);
}

+ Here is the call graph for this function:

ilSCORM2004Chapter::delete_rec (   $a_delete_meta_data = true)
private

Delete data records of chapter (and nested objects)

Definition at line 64 of file class.ilSCORM2004Chapter.php.

References ilSCORM2004Node\delete(), ilSCORM2004Node\getId(), and ilSCORM2004NodeFactory\getInstance().

Referenced by delete().

{
$childs = $this->tree->getChilds($this->getId());
foreach ($childs as $child)
{
$obj =& ilSCORM2004NodeFactory::getInstance($this->slm_object, $child["obj_id"], false);
if (is_object($obj))
{
if ($obj->getType() == "chap")
{
$obj->delete_rec($a_tree, $a_delete_meta_data);
}
if ($obj->getType() == "sco")
{
$obj->delete($a_delete_meta_data);
}
}
unset($obj);
}
parent::delete($a_delete_meta_data);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSCORM2004Chapter::exportFOPageObjects ( $a_xml_writer)

export object to fo

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data export page objects of structure object (see ilias_co.dtd)
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 342 of file class.ilSCORM2004Chapter.php.

{
// @todo Check this
/*
global $ilBench;
$this->tree = new ilTree($this->getLmId());
$this->tree->setTableNames('lm_tree', 'lm_data');
$this->tree->setTreeTablePK("lm_id");
$childs = $this->tree->getChilds($this->getId());
foreach ($childs as $child)
{
if($child["type"] != "pg")
{
continue;
}
// export xml to writer object
//$ilBench->start("ContentObjectExport", "exportStructureObject_exportPageObjectAlias");
$page_obj = new ilLMPageObject($this->getContentObject(), $child["obj_id"]);
$page_obj->exportFO($a_xml_writer);
//$ilBench->stop("ContentObjectExport", "exportStructureObject_exportPageObjectAlias");
}
*/
}
ilSCORM2004Chapter::exportXML ( $a_xml_writer,
  $a_inst,
$expLog 
)

Export object to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 118 of file class.ilSCORM2004Chapter.php.

{
// @todo
/*
global $ilBench;
$expLog->write(date("[y-m-d H:i:s] ")."Structure Object ".$this->getId());
$attrs = array();
$a_xml_writer->xmlStartTag("StructureObject", $attrs);
// MetaData
$ilBench->start("ContentObjectExport", "exportStructureObject_exportMeta");
$this->exportXMLMetaData($a_xml_writer);
$ilBench->stop("ContentObjectExport", "exportStructureObject_exportMeta");
// StructureObjects
$ilBench->start("ContentObjectExport", "exportStructureObject_exportPageObjects");
$this->exportXMLPageObjects($a_xml_writer, $a_inst);
$ilBench->stop("ContentObjectExport", "exportStructureObject_exportPageObjects");
// PageObjects
$this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);
// Layout
// not implemented
$a_xml_writer->xmlEndTag("StructureObject");
*/
}
ilSCORM2004Chapter::exportXMLMetaData ( $a_xml_writer)

export structure objects meta data to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 155 of file class.ilSCORM2004Chapter.php.

{
// @todo
/*
include_once("Services/MetaData/classes/class.ilMD2XML.php");
$md2xml = new ilMD2XML($this->getLMId(), $this->getId(), $this->getType());
$md2xml->setExportMode(true);
$md2xml->startExport();
$a_xml_writer->appendXML($md2xml->getXML());
*/
}
ilSCORM2004Chapter::exportXMLPageObjects ( $a_xml_writer,
  $a_inst = 0 
)

export page objects of structure object (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 240 of file class.ilSCORM2004Chapter.php.

{
// @todo Check this
/*
include_once './Modules/LearningModule/classes/class.ilLMPageObject.php';
global $ilBench;
$this->tree = new ilTree($this->getLmId());
$this->tree->setTableNames('lm_tree', 'lm_data');
$this->tree->setTreeTablePK("lm_id");
$childs = $this->tree->getChilds($this->getId());
foreach ($childs as $child)
{
if($child["type"] != "pg")
{
continue;
}
// export xml to writer object
$ilBench->start("ContentObjectExport", "exportStructureObject_exportPageObjectAlias");
//$ilBench->start("ContentObjectExport", "exportStructureObject_getLMPageObject");
//$page_obj = new ilLMPageObject($this->getContentObject(), $child["obj_id"]);
//$ilBench->stop("ContentObjectExport", "exportStructureObject_getLMPageObject");
ilLMPageObject::_exportXMLAlias($a_xml_writer, $child["obj_id"], $a_inst);
//$page_obj->exportXML($a_xml_writer, "alias", $a_inst);
//unset($page_obj);
$ilBench->stop("ContentObjectExport", "exportStructureObject_exportPageObjectAlias");
}
*/
}
ilSCORM2004Chapter::exportXMLStructureObjects ( $a_xml_writer,
  $a_inst,
$expLog 
)

export (sub)structure objects of structure object (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 280 of file class.ilSCORM2004Chapter.php.

{
// @todo Check this
/*
$this->tree = new ilTree($this->getLmId());
$this->tree->setTableNames('lm_tree', 'lm_data');
$this->tree->setTreeTablePK("lm_id");
$childs = $this->tree->getChilds($this->getId());
foreach ($childs as $child)
{
if($child["type"] != "st")
{
continue;
}
// export xml to writer object
$structure_obj = new ilStructureObject($this->getContentObject(),
$child["obj_id"]);
$structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
unset($structure_obj);
}
*/
}
ilSCORM2004Chapter::ilSCORM2004Chapter (   $a_slm_object,
  $a_id = 0 
)

Constructor public.

Definition at line 44 of file class.ilSCORM2004Chapter.php.

References ilSCORM2004Node\ilSCORM2004Node(), and ilSCORM2004Node\setType().

Referenced by copy(), ilSCORM2004SeqChapter\ilSCORM2004SeqChapter(), and ilSCORM2004SeqTemplate\importTemplate().

{
parent::ilSCORM2004Node($a_slm_object, $a_id);
$this->setType("chap");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilSCORM2004Chapter::$tree

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


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