ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilUserImporter.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Export/classes/class.ilXmlImporter.php");
5 
14 {
15 
19  function init()
20  {
21  include_once("./Services/User/classes/class.ilUserDataSet.php");
22  $this->ds = new ilUserDataSet();
23  $this->ds->setDSPrefix("ds");
24  $this->ds->setImportDirectory($this->getImportDirectory());
25  }
26 
27 
34  function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
35  {
36  include_once("./Services/DataSet/classes/class.ilDataSetImportParser.php");
37  $parser = new ilDataSetImportParser($a_entity, $this->getSchemaVersion(),
38  $a_xml, $this->ds, $a_mapping);
39  }
40 
41  function finalProcessing($a_mapping)
42  {
43  if(is_array($this->ds->multi))
44  {
45  foreach($this->ds->multi as $usr_id => $values)
46  {
47  $usr_obj = new ilObjUser($usr_id);
48 
49  if(isset($values["interests_general"]))
50  {
51  $usr_obj->setGeneralInterests($values["interests_general"]);
52  }
53  else
54  {
55  $usr_obj->setGeneralInterests();
56  }
57  if(isset($values["interests_help_offered"]))
58  {
59  $usr_obj->setOfferingHelp($values["interests_help_offered"]);
60  }
61  else
62  {
63  $usr_obj->setOfferingHelp();
64  }
65  if(isset($values["interests_help_looking"]))
66  {
67  $usr_obj->setLookingForHelp($values["interests_help_looking"]);
68  }
69  else
70  {
71  $usr_obj->setLookingForHelp();
72  }
73 
74  $usr_obj->updateMultiTextFields();
75  }
76  }
77  }
78 }
79 
80 ?>
getSchemaVersion()
Get schema version.
getImportDirectory()
Get import directory.
Manifest parser for ILIAS standard export files.
Importer class for user data.
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import XML.
Exercise data set class.
init()
Initialisation.
$parser
Definition: BPMN2Parser.php:24
finalProcessing($a_mapping)
Xml importer class.