ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilContainerReferenceXmlWriter Class Reference

Class for container reference export. More...

+ Inheritance diagram for ilContainerReferenceXmlWriter:
+ Collaboration diagram for ilContainerReferenceXmlWriter:

Public Member Functions

 __construct (ilContainerReference $ref=null)
 constructor
 setMode ($a_mode)
 Set export mode.
 getMode ()
 get export mode
 getReference ()
 Get category object.
 export ($a_with_header=true)
 Start wrting xml.
 getXml ()
 get 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

Data Fields

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

Protected Member Functions

 buildHeader ()
 Build xml header <type> $ilSetting.
 buildTarget ()
 Build target element.
 buildTitle ()
 Build title element.
 buildReference ()
 Build category xml.
 buildFooter ()
 Add footer elements.

Private Attributes

 $mode = self::MODE_SOAP
 $xml
 $ref

Detailed Description

Class for container reference export.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Id:
class.ilContainerReferenceXmlWriter.php 35412 2012-07-06 10:28:29Z smeyer

Definition at line 12 of file class.ilContainerReferenceXmlWriter.php.

Constructor & Destructor Documentation

ilContainerReferenceXmlWriter::__construct ( ilContainerReference  $ref = null)

constructor

Parameters
stringxml version
stringoutput encoding
stringinput encoding public

Definition at line 28 of file class.ilContainerReferenceXmlWriter.php.

References $ref.

{
$this->ref = $ref;
}

Member Function Documentation

ilContainerReferenceXmlWriter::buildFooter ( )
protected

Add footer elements.

Definition at line 144 of file class.ilContainerReferenceXmlWriter.php.

References ilXmlWriter\xmlEndTag().

Referenced by export().

{
$this->xmlEndTag('ContainerReference');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerReferenceXmlWriter::buildHeader ( )
protected

Build xml header <type> $ilSetting.

Returns
<type>

Reimplemented in ilCategoryReferenceXmlWriter, and ilCourseReferenceXmlWriter.

Definition at line 94 of file class.ilContainerReferenceXmlWriter.php.

References $ilSetting, getReference(), ilXmlWriter\xmlHeader(), ilXmlWriter\xmlSetDtdDef(), and ilXmlWriter\xmlSetGenCmt().

Referenced by export().

{
global $ilSetting;
$this->xmlSetDtdDef("<!DOCTYPE container reference PUBLIC \"-//ILIAS//DTD Group//EN\" \"".ILIAS_HTTP_PATH."/xml/ilias_container_reference_4_3.dtd\">");
$this->xmlSetGenCmt("Export of ILIAS container reference ". $this->getReference()->getId()." of installation ".$ilSetting->get('inst_id').".");
$this->xmlHeader();
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerReferenceXmlWriter::buildReference ( )
protected

Build category xml.

Definition at line 136 of file class.ilContainerReferenceXmlWriter.php.

References ilXmlWriter\xmlStartTag().

Referenced by export().

{
$this->xmlStartTag('ContainerReference');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerReferenceXmlWriter::buildTarget ( )
protected

Build target element.

Definition at line 108 of file class.ilContainerReferenceXmlWriter.php.

References getReference(), and ilXmlWriter\xmlElement().

Referenced by export().

{
$this->xmlElement('Target', array('id' => $this->getReference()->getTargetId()));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerReferenceXmlWriter::buildTitle ( )
protected

Build title element.

Definition at line 116 of file class.ilContainerReferenceXmlWriter.php.

References getReference(), ilContainerReference\TITLE_TYPE_CUSTOM, and ilXmlWriter\xmlElement().

Referenced by export().

{
$title = '';
if($this->getReference()->getTitleType() == ilContainerReference::TITLE_TYPE_CUSTOM)
{
$title = $this->getReference()->getTitle();
}
$this->xmlElement(
'Title',
array(
'type' => $this->getReference()->getTitleType()
),
$title
);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerReferenceXmlWriter::export (   $a_with_header = true)

Start wrting xml.

Definition at line 65 of file class.ilContainerReferenceXmlWriter.php.

References buildFooter(), buildHeader(), buildReference(), buildTarget(), buildTitle(), and getMode().

{
if($this->getMode() == self::MODE_EXPORT)
{
if($a_with_header)
{
$this->buildHeader();
}
$this->buildReference();
$this->buildTarget();
$this->buildTitle();
$this->buildFooter();
}
}

+ Here is the call graph for this function:

ilContainerReferenceXmlWriter::getMode ( )

get export mode

Returns
int

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

References $mode.

Referenced by export().

{
return $this->mode;
}

+ Here is the caller graph for this function:

ilContainerReferenceXmlWriter::getReference ( )

Get category object.

Returns
ilContainerReference

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

References $ref.

Referenced by ilCategoryReferenceXmlWriter\buildHeader(), ilCourseReferenceXmlWriter\buildHeader(), buildHeader(), buildTarget(), and buildTitle().

{
return $this->ref;
}

+ Here is the caller graph for this function:

ilContainerReferenceXmlWriter::getXml ( )

get XML

Returns
string

Definition at line 84 of file class.ilContainerReferenceXmlWriter.php.

References ilXmlWriter\xmlDumpMem().

{
return $this->xmlDumpMem(false);
}

+ Here is the call graph for this function:

ilContainerReferenceXmlWriter::setMode (   $a_mode)

Set export mode.

Parameters
int$a_mode

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

{
$this->mode = $a_mode;
}

Field Documentation

ilContainerReferenceXmlWriter::$mode = self::MODE_SOAP
private

Definition at line 17 of file class.ilContainerReferenceXmlWriter.php.

Referenced by getMode().

ilContainerReferenceXmlWriter::$ref
private
ilContainerReferenceXmlWriter::$xml
private

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

const ilContainerReferenceXmlWriter::MODE_EXPORT = 2
const ilContainerReferenceXmlWriter::MODE_SOAP = 1

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


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