ILIAS  release_8 Revision v8.23
ilSurveyQuestionPoolImporter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilSurveyQuestionPoolImporter:
+ Collaboration diagram for ilSurveyQuestionPoolImporter:

Public Member Functions

 importXmlRepresentation (string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
 
- Public Member Functions inherited from ilXmlImporter
 __construct ()
 
 setImport (ilImport $a_val)
 
 getImport ()
 
 init ()
 
 setInstallId (string $a_val)
 
 getInstallId ()
 
 setInstallUrl (string $a_val)
 
 getInstallUrl ()
 
 setSchemaVersion (string $a_val)
 
 getSchemaVersion ()
 
 setImportDirectory (string $a_val)
 
 getImportDirectory ()
 
 setSkipEntities (array $a_val)
 
 getSkipEntities ()
 
 exportedFromSameInstallation ()
 
 importXmlRepresentation (string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
 
 finalProcessing (ilImportMapping $a_mapping)
 
 afterContainerImportProcessing (ilImportMapping $mapping)
 

Protected Member Functions

 getXmlFileName ()
 

Additional Inherited Members

- Protected Attributes inherited from ilXmlImporter
array $skip_entities = array()
 
ilImport $imp
 
string $install_id
 
string $install_url
 
string $schema_version
 
string $import_directory
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Importer class for files

Author
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de

Definition at line 23 of file class.ilSurveyQuestionPoolImporter.php.

Member Function Documentation

◆ getXmlFileName()

ilSurveyQuestionPoolImporter::getXmlFileName ( )
protected

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

References ilXmlImporter\getImportDirectory().

Referenced by importXmlRepresentation().

57  : string
58  {
59  $basename = basename($this->getImportDirectory());
60  return $this->getImportDirectory() . '/' . $basename . '.xml';
61  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importXmlRepresentation()

ilSurveyQuestionPoolImporter::importXmlRepresentation ( string  $a_entity,
string  $a_id,
string  $a_xml,
ilImportMapping  $a_mapping 
)

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

References $GLOBALS, ilImportMapping\addMapping(), ilObjectFactory\getInstanceByObjId(), ilImportMapping\getMapping(), and getXmlFileName().

30  : void {
31  // Container import => test object already created
32  if ($new_id = $a_mapping->getMapping('Services/Container', 'objs', $a_id)) {
33  $newObj = ilObjectFactory::getInstanceByObjId($new_id, false);
34  } else { // case ii, non container
35  // Shouldn't happen
36  $GLOBALS['ilLog']->write(__METHOD__ . ': Called in non container mode');
37  return;
38  }
39 
40  $xml_file = $this->getXmlFileName();
41 
42  if (!file_exists($xml_file)) {
43  $GLOBALS['ilLog']->write(__METHOD__ . ': Cannot find xml definition: ' . $xml_file);
44  return;
45  }
46 
47  // import qti data
48  $newObj->importObject($xml_file);
49  $a_mapping->addMapping(
50  "Modules/SurveyQuestionPool",
51  "spl",
52  $a_id,
53  $newObj->getId()
54  );
55  }
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
getMapping(string $a_comp, string $a_entity, string $a_old_id)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:

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