ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSoapStructureObjectAdministration.php
Go to the documentation of this file.
1<?php
23{
27 public function getStructureObjects(string $sid, int $ref_id)
28 {
29 $this->initAuth($sid);
30 $this->initIlias();
31
32 if (!$this->checkSession($sid)) {
33 return $this->raiseError($this->getMessage(), $this->getMessageCode());
34 }
35
36 if (!$target_obj = ilObjectFactory::getInstanceByRefId($ref_id, false)) {
37 return $this->raiseError('No valid reference id given.', 'Client');
38 }
39
40 $structureReaderClassname = "ilSoap" . strtoupper($target_obj->getType()) . "StructureReader";
41 $filename = "./components/ILIAS/soap/classes/class." . $structureReaderClassname . ".php";
42
43 if (!file_exists($filename)) {
44 return $this->raiseError("Object type '" . $target_obj->getType() . "'is not supported.", 'Client');
45 }
46
47 include_once $filename;
48 $structureReader = new $structureReaderClassname($target_obj);
49 $xml_writer = new ilSoapStructureObjectXMLWriter();
50 $structureObject = &$structureReader->getStructureObject();
51 $xml_writer->setStructureObject($structureObject);
52 if (!$xml_writer->start()) {
53 return $this->raiseError('Cannot create object xml !', 'Server');
54 }
55 return $xml_writer->getXML();
56 }
57}
$filename
Definition: buildRTE.php:78
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
raiseError(string $a_message, $a_code)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ref_id
Definition: ltiauth.php:66