3 declare(strict_types=1);
    54         $parts = explode(
":", $a_obj_id);
    56         $this->mapping = $a_mapping;
    62         $this->sax_controller->setHandlers($a_xml_parser);
    63         $this->sax_controller->setDefaultElementHandler($this);
    66     public function createLocalRecord(
int $a_old_id, 
string $a_xml, 
int $a_obj_id, ?
string $a_sub_type = null): void
    69         file_put_contents($tmp_file, $a_xml);
    78             $parser->startParsing();
    80             $parser->startParsing();
    82             $this->log->error(
'Parsing failed with message: ' . $exc->getMessage());
    87         $map = $parser->getRecordMap();
    88         foreach ($map as $record_id => $fields) {
    89             $this->local_rec_fields_map[$record_id] = $fields;
    92             foreach ($fields as $import_id => $new_id) {
    93                 $import_ids = explode(
'_', $import_id);
    94                 $old_id = array_pop($import_ids);
    95                 $this->mapping->addMapping(
"components/ILIAS/AdvancedMetaData", 
"lfld", $old_id, (
string) $new_id);
    98         $map_keys = array_keys($map);
    99         $new_id = array_shift($map_keys);
   100         $this->local_rec_map[$a_old_id] = $new_id;
   103     public function handlerBeginTag($a_xml_parser, 
string $a_name, array $a_attribs): void
   106             case 'AdvancedMetaData':
   110                 $this->local_record = array(
'id' => $a_attribs[
'local_id']);
   115                     (
string) $a_attribs[
'id'],
   116                     (
string) $a_attribs[
'sub_type'],
   117                     (
int) $a_attribs[
'sub_id'],
   118                     isset($a_attribs[
'local_rec_id']) ? (
int) $a_attribs[
'local_rec_id'] : null
   127             case 'AdvancedMetaData':
   129                 foreach ($this->value_records as $record) {
   135                 $this->local_record[
'xml'] = base64_decode(trim($this->cdata));
   136                 $this->log->debug(
"Local Record XML: " . $this->local_record[
'xml']);
   140                 $value = trim($this->cdata);
   141                 $this->log->debug(
"End Tag Value: -" . is_object($this->current_value) . 
"-" . $value);
   142                 if (is_object($this->current_value) && $value != 
"") {
   143                     $this->current_value->importValueFromXML($value);
   152         if ($a_data != 
"\n") {
   154             $a_data = preg_replace(
"/\t+/", 
" ", $a_data);
   156             $this->cdata .= $a_data;
   162         string $a_sub_type = 
"",
   164         int $a_local_rec_id = null
   166         $this->current_value = null;
   169         $new_parent_id = (
int) $this->mapping->getMapping(
"components/ILIAS/AdvancedMetaData", 
"parent", (
string) $this->obj_id);
   170         $this->log->notice(
'Found new parent id:' . $new_parent_id);
   171         if (!$new_parent_id) {
   175         if ($a_sub_type && strcmp($a_sub_type, 
'-') !== 0) {
   176             $new_sub_id = $this->mapping->getMapping(
   177                 "components/ILIAS/AdvancedMetaData",
   179                 "advmd:" . $a_sub_type . 
":" . $a_sub_id
   188         if (is_array($this->local_record)) {
   190                 (
int) $this->local_record[
'id'],
   191                 $this->local_record[
'xml'],
   195             $this->local_record = null;
   201         if (!$a_local_rec_id) {
   203                 $rec_id = $field->getRecordId();
   207             $rec_id = $this->local_rec_map[$a_local_rec_id];
   216             $rec_idx = $rec_id . 
";" . $a_sub_type . 
";" . $new_sub_id;
   217             if (!array_key_exists($rec_idx, $this->value_records)) {
   226             $rec_idx = $rec_id . 
";;";
   227             if (!array_key_exists($rec_idx, $this->value_records)) {
   233         $this->value_records[$rec_idx]->getADTGroup();
   236         $this->log->debug(
"Find element: " . $a_import_id . 
", local rec_id: " . $a_local_rec_id);
   237         if (!$a_local_rec_id) {
   238             foreach ($this->value_records[$rec_idx]->getDefinitions() as $def) {
   239                 if ($a_import_id == $def->getImportId()) {
   240                     $this->current_value = $def;
   246             $field_id = $this->local_rec_fields_map[
$rec_id][$a_import_id];
   248                 $this->log->debug(
"- Field id: " . $field_id);
   249                 foreach ($this->value_records[$rec_idx]->getDefinitions() as $def) {
   250                     $this->log->debug(
"- Def field id: " . $def->getFieldId());
   251                     if ($field_id == $def->getFieldId()) {
   252                         $this->current_value = $def;
   257                 $this->log->debug(
"- No Field id. local rec: " . $a_local_rec_id .
   258                     ", rec id:" . $rec_id . 
", import id: " . $a_import_id . 
", map: " . print_r(
   259                         $this->local_rec_fields_map,
   267         if ($this->current_value &&
   269             $this->record_ids[$new_parent_id][$a_sub_type][] = 
$rec_id;
 
static getInstanceByImportId(string $a_import_id)
 
static getLogger(string $a_component_id)
Get component logger. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
 
AMD field abstract base class. 
 
SaxParserException thrown by ilSaxParser if property throwException is set. 
 
ilAdvancedMDFieldDefinition $current_value
 
__construct(string $a_obj_id, ilImportMapping $a_mapping)
 
createLocalRecord(int $a_old_id, string $a_xml, int $a_obj_id, ?string $a_sub_type=null)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
handlerEndTag($a_xml_parser, string $a_name)
End element handler. 
 
setHandlers($a_xml_parser)
 
handlerBeginTag($a_xml_parser, string $a_name, array $a_attribs)
Start element handler. 
 
array $local_rec_fields_map
 
initValue(string $a_import_id, string $a_sub_type="", int $a_sub_id=0, int $a_local_rec_id=null)
 
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory. 
 
Interface definition for sax subset parsers. 
 
Controller class for sax element handlers. 
 
__construct(Container $dic, ilPlugin $plugin)
 
handlerCharacterData($a_xml_parser, string $a_data)
Character data handler. 
 
ilSaxController $sax_controller
 
static _lookupType(int $id, bool $reference=false)
 
SAX based XML parser for record import files. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
const MODE_INSERT_VALIDATION