ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilGroupXMLWriter Class Reference

XML writer class. More...

+ Inheritance diagram for ilGroupXMLWriter:
+ Collaboration diagram for ilGroupXMLWriter:

Public Member Functions

 ilGroupXMLWriter ($group_obj)
 constructor
 setMode ($a_mode)
 getMode ()
 start ()
 getXML ()
 __buildHeader ()
 __buildGroup ()
 Group start.
 __buildTitleDescription ()
 __buildRegistration ()
 __buildAdmin ()
 __buildMember ()
 __buildFooter ()
 setAttachUsers ($value)
- 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"

Private Attributes

 $mode = self::MODE_SOAP
 $ilias
 $xml
 $group_obj
 $attach_users = true

Detailed Description

XML writer class.

Class for writing xml export versions of courses

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id:
class.ilGroupXMLWriter.php 16108 2008-02-28 17:36:41Z rkuester

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

Member Function Documentation

ilGroupXMLWriter::__buildAdmin ( )

Definition at line 209 of file class.ilGroupXMLWriter.php.

References ilXmlWriter\xmlElement().

Referenced by start().

{
foreach($this->group_obj->getGroupAdminIds() as $id)
{
$attr['id'] = 'il_'.$this->ilias->getSetting('inst_id').'_usr_'.$id;
$attr['notification'] = $this->participants->isNotificationEnabled($id) ? 'Yes' : 'No';
$this->xmlElement('admin',$attr);
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGroupXMLWriter::__buildFooter ( )

Definition at line 235 of file class.ilGroupXMLWriter.php.

References ilXmlWriter\xmlEndTag().

Referenced by start().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGroupXMLWriter::__buildGroup ( )

Group start.

Returns

Definition at line 126 of file class.ilGroupXMLWriter.php.

References GRP_TYPE_CLOSED, GRP_TYPE_PUBLIC, and ilXmlWriter\xmlStartTag().

Referenced by start().

{
$attrs["exportVersion"] = $this->EXPORT_VERSION;
$attrs["id"] = "il_".$this->ilias->getSetting('inst_id').'_grp_'.$this->group_obj->getId();
switch($this->group_obj->readGroupStatus())
{
$attrs['type'] = 'open';
break;
default:
$attrs['type'] = 'closed';
break;
}
$this->xmlStartTag("group", $attrs);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGroupXMLWriter::__buildHeader ( )

Definition at line 112 of file class.ilGroupXMLWriter.php.

References ilXmlWriter\xmlHeader(), ilXmlWriter\xmlSetDtdDef(), and ilXmlWriter\xmlSetGenCmt().

Referenced by start().

{
$this->xmlSetDtdDef("<!DOCTYPE group PUBLIC \"-//ILIAS//DTD Group//EN\" \"".ILIAS_HTTP_PATH."/xml/ilias_group_3_10.dtd\">");
$this->xmlSetGenCmt("Export of ILIAS group ". $this->group_obj->getId()." of installation ".$this->ilias->getSetting('inst_id').".");
$this->xmlHeader();
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGroupXMLWriter::__buildMember ( )

Definition at line 221 of file class.ilGroupXMLWriter.php.

References ilXmlWriter\xmlElement().

Referenced by start().

{
foreach($this->group_obj->getGroupMemberIds() as $id)
{
if(!$this->group_obj->isAdmin($id))
{
$attr['id'] = 'il_'.$this->ilias->getSetting('inst_id').'_usr_'.$id;
$this->xmlElement('member',$attr);
}
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGroupXMLWriter::__buildRegistration ( )

Definition at line 161 of file class.ilGroupXMLWriter.php.

References GRP_REGISTRATION_DEACTIVATED, GRP_REGISTRATION_DIRECT, GRP_REGISTRATION_PASSWORD, GRP_REGISTRATION_REQUEST, IL_CAL_UNIX, ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by start().

{
// registration type
switch($this->group_obj->getRegistrationType())
{
$attrs['type'] = 'direct';
break;
$attrs['type'] = 'confirmation';
break;
$attrs['type'] = 'password';
break;
default:
$attrs['type'] = 'disabled';
break;
}
$attrs['waitingList'] = $this->group_obj->isWaitingListEnabled() ? 'Yes' : 'No';
$this->xmlStartTag('registration',$attrs);
if(strlen($pwd = $this->group_obj->getPassword()))
{
$this->xmlElement('password',null,$pwd);
}
// limited registration period
if(!$this->group_obj->isRegistrationUnlimited())
{
$this->xmlStartTag('temporarilyAvailable');
$this->xmlElement('start',null,$this->group_obj->getRegistrationStart()->get(IL_CAL_UNIX));
$this->xmlElement('end',null,$this->group_obj->getRegistrationEnd()->get(IL_CAL_UNIX));
$this->xmlEndTag('temporarilyAvailable');
}
// max members
$attrs = array();
$attrs['enabled'] = $this->group_obj->isMembershipLimited() ? 'Yes' : 'No';
$this->xmlElement('maxMembers',$attrs,$this->group_obj->getMaxMembers());
$this->xmlEndTag('registration');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGroupXMLWriter::__buildTitleDescription ( )

Definition at line 146 of file class.ilGroupXMLWriter.php.

References ilXmlWriter\xmlElement().

Referenced by start().

{
$this->xmlElement('title',null,$this->group_obj->getTitle());
if($desc = $this->group_obj->getDescription())
{
$this->xmlElement('description',null,$desc);
}
$attr['id'] = 'il_'.$this->ilias->getSetting('inst_id').'_usr_'.$this->group_obj->getOwner();
$this->xmlElement('owner',$attr);
$this->xmlElement('information',null,$this->group_obj->getInformation());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGroupXMLWriter::getMode ( )

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

References $mode.

Referenced by start().

{
return $this->mode;
}

+ Here is the caller graph for this function:

ilGroupXMLWriter::getXML ( )

Definition at line 106 of file class.ilGroupXMLWriter.php.

References ilXmlWriter\xmlDumpMem().

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

+ Here is the call graph for this function:

ilGroupXMLWriter::ilGroupXMLWriter (   $group_obj)

constructor

Parameters
stringxml version
stringoutput encoding
stringinput encoding public

Definition at line 57 of file class.ilGroupXMLWriter.php.

References $group_obj, $ilias, ilGroupParticipants\_getInstanceByObjId(), and ilXmlWriter\ilXmlWriter().

{
global $ilias;
$this->EXPORT_VERSION = "3";
$this->ilias =& $ilias;
$this->group_obj =& $group_obj;
$this->participants = ilGroupParticipants::_getInstanceByObjId($this->group_obj->getId());
}

+ Here is the call graph for this function:

ilGroupXMLWriter::setAttachUsers (   $value)

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

{
$this->attach_users = $value ? true : false;
}
ilGroupXMLWriter::setMode (   $a_mode)

Definition at line 71 of file class.ilGroupXMLWriter.php.

{
$this->mode = $a_mode;
}
ilGroupXMLWriter::start ( )

Definition at line 81 of file class.ilGroupXMLWriter.php.

References __buildAdmin(), __buildFooter(), __buildGroup(), __buildHeader(), __buildMember(), __buildRegistration(), __buildTitleDescription(), and getMode().

{
if($this->getMode() == self::MODE_SOAP)
{
$this->__buildHeader();
$this->__buildGroup();
if ($this->attach_users)
{
$this->__buildAdmin();
$this->__buildMember();
}
$this->__buildFooter();
}
elseif($this->getMode() == self::MODE_EXPORT)
{
$this->__buildGroup();
$this->__buildFooter();
}
}

+ Here is the call graph for this function:

Field Documentation

ilGroupXMLWriter::$attach_users = true
private

Definition at line 48 of file class.ilGroupXMLWriter.php.

ilGroupXMLWriter::$group_obj
private

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

Referenced by ilGroupXMLWriter().

ilGroupXMLWriter::$ilias
private

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

Referenced by ilGroupXMLWriter().

ilGroupXMLWriter::$mode = self::MODE_SOAP
private

Definition at line 41 of file class.ilGroupXMLWriter.php.

Referenced by getMode().

ilGroupXMLWriter::$xml
private

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

const ilGroupXMLWriter::MODE_EXPORT = 2

Definition at line 39 of file class.ilGroupXMLWriter.php.

Referenced by ilGroupExporter\getXmlRepresentation().

const ilGroupXMLWriter::MODE_SOAP = 1

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


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