ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilContainerReferenceXmlWriter Class Reference

Class for container reference export. More...

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

Public Member Functions

 __construct (?ilContainerReference $ref=null)
 
 setMode (int $a_mode)
 
 getMode ()
 
 getReference ()
 
 export (bool $a_with_header=true)
 
 getXml ()
 
- Public Member Functions inherited from ilXmlWriter
 __construct (string $version="1.0", string $outEnc="utf-8", string $inEnc="utf-8")
 
 xmlSetDtdDef (string $dtdDef)
 Sets dtd definition. More...
 
 xmlSetGenCmt (string $genCmt)
 Sets generated comment. More...
 
 xmlFormatData (string $data)
 Indents text for better reading. More...
 
 xmlHeader ()
 Writes xml header. More...
 
 xmlStartTag (string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
 Writes a starttag. More...
 
 xmlEndTag (string $tag)
 Writes an endtag. More...
 
 xmlData (string $data, bool $encode=true, bool $escape=true)
 Writes data. More...
 
 xmlElement (string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
 Writes a basic element (no children, just textual content) More...
 
 xmlDumpFile (string $file, bool $format=true)
 Dumps xml document from memory into a file. More...
 
 xmlDumpMem (bool $format=true)
 Returns xml document from memory. More...
 
 appendXML (string $a_str)
 append xml string to document More...
 
 xmlClear ()
 clears xmlStr More...
 

Data Fields

const MODE_SOAP = 1
 
const MODE_EXPORT = 2
 

Protected Member Functions

 buildHeader ()
 
 buildTarget ()
 
 buildTitle ()
 
 buildReference ()
 
 buildFooter ()
 

Protected Attributes

ilSetting $settings
 

Private Attributes

int $mode = self::MODE_SOAP
 
ilContainerReference $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

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

Constructor & Destructor Documentation

◆ __construct()

ilContainerReferenceXmlWriter::__construct ( ?ilContainerReference  $ref = null)

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

37 {
38 global $DIC;
39
40 $this->settings = $DIC->settings();
42 $this->ref = $ref;
43 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, $ref, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildFooter()

ilContainerReferenceXmlWriter::buildFooter ( )
protected

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

110 : void
111 {
112 $this->xmlEndTag('ContainerReference');
113 }
xmlEndTag(string $tag)
Writes an endtag.

References ilXmlWriter\xmlEndTag().

Referenced by export(), and ilCourseReferenceXmlWriter\export().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildHeader()

ilContainerReferenceXmlWriter::buildHeader ( )
protected

Reimplemented in ilCategoryReferenceXmlWriter, ilCourseReferenceXmlWriter, and ilGroupReferenceXmlWriter.

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

78 : void
79 {
80 $this->xmlSetGenCmt("Export of ILIAS container reference " . $this->getReference()->getId() . " of installation " . $this->settings->get('inst_id') . ".");
81 $this->xmlHeader();
82 }
xmlSetGenCmt(string $genCmt)
Sets generated comment.
xmlHeader()
Writes xml header.

References ILIAS\Survey\Mode\getId(), getReference(), ILIAS\Repository\settings(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlSetGenCmt().

Referenced by export().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildReference()

ilContainerReferenceXmlWriter::buildReference ( )
protected

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

105 : void
106 {
107 $this->xmlStartTag('ContainerReference');
108 }
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.

References ilXmlWriter\xmlStartTag().

Referenced by export(), and ilCourseReferenceXmlWriter\export().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildTarget()

ilContainerReferenceXmlWriter::buildTarget ( )
protected

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

84 : void
85 {
86 $this->xmlElement('Target', ['id' => $this->getReference()->getTargetId()]);
87 }
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)

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

Referenced by export(), and ilCourseReferenceXmlWriter\export().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildTitle()

ilContainerReferenceXmlWriter::buildTitle ( )
protected

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

89 : void
90 {
91 $title = '';
92 if ($this->getReference()->getTitleType() === ilContainerReference::TITLE_TYPE_CUSTOM) {
93 $title = $this->getReference()->getTitle();
94 }
95
96 $this->xmlElement(
97 'Title',
98 [
99 'type' => $this->getReference()->getTitleType()
100 ],
101 $title
102 );
103 }

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

Referenced by export(), and ilCourseReferenceXmlWriter\export().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ export()

ilContainerReferenceXmlWriter::export ( bool  $a_with_header = true)

◆ getMode()

ilContainerReferenceXmlWriter::getMode ( )

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

References $mode.

Referenced by export(), and ilCourseReferenceXmlWriter\export().

+ Here is the caller graph for this function:

◆ getReference()

◆ getXml()

ilContainerReferenceXmlWriter::getXml ( )

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

73 : string
74 {
75 return $this->xmlDumpMem(false);
76 }
xmlDumpMem(bool $format=true)
Returns xml document from memory.

References ilXmlWriter\xmlDumpMem().

+ Here is the call graph for this function:

◆ setMode()

ilContainerReferenceXmlWriter::setMode ( int  $a_mode)

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

45 : void
46 {
47 $this->mode = $a_mode;
48 }

Field Documentation

◆ $mode

int ilContainerReferenceXmlWriter::$mode = self::MODE_SOAP
private

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

Referenced by getMode().

◆ $ref

◆ $settings

ilSetting ilContainerReferenceXmlWriter::$settings
protected

◆ MODE_EXPORT

const ilContainerReferenceXmlWriter::MODE_EXPORT = 2

◆ MODE_SOAP

const ilContainerReferenceXmlWriter::MODE_SOAP = 1

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


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