ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLPXmlWriter Class Reference

XML writer learning progress. More...

+ Inheritance diagram for ilLPXmlWriter:
+ Collaboration diagram for ilLPXmlWriter:

Public Member Functions

 __construct ($a_add_header)
 Constructor.
 setTimestamp ($a_val)
 Set timestamp.
 getTimestamp ()
 Get timestamp.
 setIncludeRefIds ($a_val)
 Set include ref ids.
 getIncludeRefIds ()
 Get include ref ids.
 setTypeFilter ($a_val)
 Set type filter.
 getTypeFilter ()
 Get type filter.
 write ()
 Write XML.
 addLPInformation ()
 Add lp information as xml.
- Public Member Functions inherited from ilXmlWriter
 ilXmlWriter ($version="1.0", $outEnc="utf-8", $inEnc="utf-8")
 constructor
 _ilXmlWriter ()
 destructor public
 xmlSetDtdDef ($dtdDef)
 Sets dtd definition.
 xmlSetStSheet ($stSheet)
 Sets stylesheet.
 xmlSetGenCmt ($genCmt)
 Sets generated comment.
 _xmlEscapeData ($data)
 Escapes reserved characters.
 xmlEncodeData ($data)
 Encodes text from input encoding into output encoding.
 xmlFormatData ($data)
 Indents text for better reading.
 xmlFormatElement ($array)
 Callback function for xmlFormatData; do not invoke directly.
 xmlHeader ()
 Writes xml header public.
 xmlStartTag ($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
 Writes a starttag.
 xmlEndTag ($tag)
 Writes an endtag.
 xmlComment ($comment)
 Writes a comment.
 xmlData ($data, $encode=TRUE, $escape=TRUE)
 Writes data.
 xmlElement ($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
 Writes a basic element (no children, just textual content)
 xmlDumpFile ($file, $format=TRUE)
 Dumps xml document from memory into a file.
 xmlDumpMem ($format=TRUE)
 Returns xml document from memory.
 appendXML ($a_str)
 append xml string to document
 xmlClear ()
 clears xmlStr public

Protected Member Functions

 buildHeader ()
 Build XML header.
 init ()
 Init xml writer.

Private Attributes

 $add_header = true
 $timestamp = ""
 $include_ref_ids = false
 $type_filter = array()

Additional Inherited Members

- Data Fields inherited from ilXmlWriter
 $xmlStr
 $version
 $outEnc
 $inEnc
 $dtdDef = ""
 $stSheet = ""
 $genCmt = "Generated by ILIAS XmlWriter"

Detailed Description

XML writer learning progress.

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

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

Constructor & Destructor Documentation

ilLPXmlWriter::__construct (   $a_add_header)

Constructor.

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

{
$this->add_header = $a_add_header;
}

Member Function Documentation

ilLPXmlWriter::addLPInformation ( )

Add lp information as xml.

Parameters
@return

Definition at line 141 of file class.ilLPXmlWriter.php.

References ilObject\_getAllReferences(), ilObject\_lookupType(), getIncludeRefIds(), getTypeFilter(), ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by write().

{
global $ilDB;
$this->xmlStartTag('LPData', array());
$set = $ilDB->query($q = "SELECT * FROM ut_lp_marks ".
" WHERE status_changed >= ".$ilDB->quote($this->getTimestamp(), "timestamp")
);
while ($rec = $ilDB->fetchAssoc($set))
{
$ref_ids = array();
if ($this->getIncludeRefIds())
{
$ref_ids = ilObject::_getAllReferences($rec["obj_id"]);
}
if (!is_array($this->getTypeFilter()) ||
(count($this->getTypeFilter()) == 0) ||
in_array(ilObject::_lookupType($rec["obj_id"]), $this->getTypeFilter()))
{
$this->xmlElement('LPChange',
array(
'UserId' => $rec["usr_id"],
'ObjId' => $rec["obj_id"],
'RefIds' => implode($ref_ids, ","),
'Timestamp' => $rec["status_changed"],
'LPStatus' => $rec["status"]
)
);
}
}
$this->xmlEndTag('LPData');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPXmlWriter::buildHeader ( )
protected

Build XML header.

Returns

Definition at line 110 of file class.ilLPXmlWriter.php.

References ilXmlWriter\xmlHeader().

Referenced by write().

{
//$this->xmlSetDtdDef("<!DOCTYPE LearningProgress PUBLIC \"-//ILIAS//DTD WebLinkAdministration//EN\" \"".ILIAS_HTTP_PATH."/xml/ilias_weblinks_4_0.dtd\">");
//$this->xmlSetGenCmt("WebLink Object");
$this->xmlHeader();
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPXmlWriter::getIncludeRefIds ( )

Get include ref ids.

Returns
bool include ref ids

Definition at line 66 of file class.ilLPXmlWriter.php.

References $include_ref_ids.

Referenced by addLPInformation().

+ Here is the caller graph for this function:

ilLPXmlWriter::getTimestamp ( )

Get timestamp.

Returns
string timestamp (YYYY-MM-DD hh:mm:ss)

Definition at line 46 of file class.ilLPXmlWriter.php.

References $timestamp.

{
}
ilLPXmlWriter::getTypeFilter ( )

Get type filter.

Returns
array string of arrays

Definition at line 86 of file class.ilLPXmlWriter.php.

References $type_filter.

Referenced by addLPInformation().

{
}

+ Here is the caller graph for this function:

ilLPXmlWriter::init ( )
protected

Init xml writer.

Returns
bool
Exceptions
UnexpectedValueExceptionThrown if obj_id is not of type webr

Definition at line 125 of file class.ilLPXmlWriter.php.

References ilXmlWriter\xmlClear().

Referenced by write().

{
$this->xmlClear();
/* if(!$this->obj_id)
{
throw new UnexpectedValueException('No obj_id given: ');
}*/
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPXmlWriter::setIncludeRefIds (   $a_val)

Set include ref ids.

Parameters
bool$a_valinclude ref ids

Definition at line 56 of file class.ilLPXmlWriter.php.

{
$this->include_ref_ids = $a_val;
}
ilLPXmlWriter::setTimestamp (   $a_val)

Set timestamp.

Parameters
string$a_valtimestamp (YYYY-MM-DD hh:mm:ss)

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

{
$this->timestamp = $a_val;
}
ilLPXmlWriter::setTypeFilter (   $a_val)

Set type filter.

Parameters
array$a_valstring of arrays

Definition at line 76 of file class.ilLPXmlWriter.php.

{
$this->type_filter = $a_val;
}
ilLPXmlWriter::write ( )

Write XML.

Returns
Exceptions
UnexpectedValueExceptionThrown if obj_id is not of type webr or no obj_id is given

Definition at line 96 of file class.ilLPXmlWriter.php.

References addLPInformation(), buildHeader(), and init().

{
$this->init();
if($this->add_header)
{
$this->buildHeader();
}
$this->addLPInformation();
}

+ Here is the call graph for this function:

Field Documentation

ilLPXmlWriter::$add_header = true
private

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

ilLPXmlWriter::$include_ref_ids = false
private

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

Referenced by getIncludeRefIds().

ilLPXmlWriter::$timestamp = ""
private

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

Referenced by getTimestamp().

ilLPXmlWriter::$type_filter = array()
private

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

Referenced by getTypeFilter().


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