ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLOXmlWriter Class Reference

Class ilLOXmlWriter. More...

+ Collaboration diagram for ilLOXmlWriter:

Public Member Functions

 __construct ($a_ref_id)
 Constructor. More...
 
 write ()
 Write xml. More...
 
 getXml ()
 Get xml. More...
 

Data Fields

const TYPE_TST_PO = 1
 
const TYPE_TST_ALL = 2
 
const TYPE_TST_RND = 3
 

Protected Member Functions

 getWriter ()
 Get writer. More...
 

Protected Attributes

 $log = null
 

Private Attributes

 $ref_id = 0
 
 $obj_id = 0
 
 $writer = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLOXmlWriter::__construct (   $a_ref_id)

Constructor.

Definition at line 30 of file class.ilLOXmlWriter.php.

References $GLOBALS, and ilObject\_lookupObjectId().

31  {
32  $this->ref_id = $a_ref_id;
33  $this->obj_id = ilObject::_lookupObjectId($a_ref_id);
34 
35  include_once './Services/Xml/classes/class.ilXmlWriter.php';
36  $this->writer = new ilXmlWriter();
37 
38  $this->log = $GLOBALS['DIC']->logger()->crs();
39  }
XML writer class.
static _lookupObjectId($a_ref_id)
lookup object id
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

Member Function Documentation

◆ getWriter()

ilLOXmlWriter::getWriter ( )
protected

Get writer.

Returns

Definition at line 45 of file class.ilLOXmlWriter.php.

References $writer.

Referenced by getXml(), and write().

46  {
47  return $this->writer;
48  }
+ Here is the caller graph for this function:

◆ getXml()

ilLOXmlWriter::getXml ( )

Get xml.

Returns
type

Definition at line 89 of file class.ilLOXmlWriter.php.

References getWriter().

90  {
91  return $this->getWriter()->xmlDumpMem(false);
92  }
getWriter()
Get writer.
+ Here is the call graph for this function:

◆ write()

ilLOXmlWriter::write ( )

Write xml.

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

References $DIC, $factory, $ilSetting, ilCourseObjective\_getObjectiveIds(), ilLOSettings\getInstanceByObjId(), and getWriter().

54  {
55  global $DIC;
56 
57  $ilSetting = $DIC['ilSetting'];
58 
59  $this->getWriter()->xmlStartTag('Objectives');
60 
61  // export settings
62  include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
63  $settings = ilLOSettings::getInstanceByObjId($this->obj_id);
64  $settings->toXml($this->getWriter());
65 
66  $factory = new ilObjectFactory();
67  $course = $factory->getInstanceByRefId($this->ref_id, false);
68  if (!$course instanceof ilObjCourse) {
69  $this->log->warning('Cannot create course instance for ref_id: ' . $this->ref_id);
70  return;
71  }
72 
73  include_once './Modules/Course/classes/class.ilCourseObjective.php';
74 
75  $this->log->debug('Writing objective xml');
76  foreach (ilCourseObjective::_getObjectiveIds($this->obj_id) as $objective_id) {
77  $this->log->debug('Handling objective_id: ' . $objective_id);
78  $objective = new ilCourseObjective($course, $objective_id);
79  $objective->toXml($this->getWriter());
80  }
81 
82  $this->getWriter()->xmlEndTag('Objectives');
83  }
static getInstanceByObjId($a_obj_id)
get singleton instance
Class ilObjectFactory.
global $DIC
Definition: saml.php:7
$factory
Definition: metadata.php:43
static _getObjectiveIds($course_id, $a_activated_only=false)
getWriter()
Get writer.
Class ilObjCourse.
class ilcourseobjective
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:

Field Documentation

◆ $log

ilLOXmlWriter::$log = null
protected

Definition at line 25 of file class.ilLOXmlWriter.php.

◆ $obj_id

ilLOXmlWriter::$obj_id = 0
private

Definition at line 19 of file class.ilLOXmlWriter.php.

◆ $ref_id

ilLOXmlWriter::$ref_id = 0
private

Definition at line 18 of file class.ilLOXmlWriter.php.

◆ $writer

ilLOXmlWriter::$writer = null
private

Definition at line 20 of file class.ilLOXmlWriter.php.

Referenced by getWriter().

◆ TYPE_TST_ALL

const ilLOXmlWriter::TYPE_TST_ALL = 2

Definition at line 15 of file class.ilLOXmlWriter.php.

Referenced by ilCourseObjectiveQuestion\toXml().

◆ TYPE_TST_PO

const ilLOXmlWriter::TYPE_TST_PO = 1

Definition at line 14 of file class.ilLOXmlWriter.php.

Referenced by ilLOTestAssignments\toXml().

◆ TYPE_TST_RND

const ilLOXmlWriter::TYPE_TST_RND = 3

Definition at line 16 of file class.ilLOXmlWriter.php.

Referenced by ilLORandomTestQuestionPools\toXml().


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