ILIAS  release_8 Revision v8.24
ilWebResourceImporter 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 ilWebResourceImporter:
+ Collaboration diagram for ilWebResourceImporter:

Public Member Functions

 __construct ()
 
 importXmlRepresentation (string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
 @inheritDoc More...
 
- 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 Attributes

ilObjLinkResource $link = null
 
ilLogger $logger
 
- 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 Webresource xml importer

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 26 of file class.ilWebResourceImporter.php.

Constructor & Destructor Documentation

◆ __construct()

ilWebResourceImporter::__construct ( )

Reimplemented from ilXmlImporter.

Definition at line 32 of file class.ilWebResourceImporter.php.

33 {
34 global $DIC;
35
37 $this->logger = $DIC->logger()->webr();
38 }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\logger().

+ Here is the call graph for this function:

Member Function Documentation

◆ importXmlRepresentation()

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

@inheritDoc

Reimplemented from ilXmlImporter.

Definition at line 43 of file class.ilWebResourceImporter.php.

48 : void {
49 if ($new_id = $a_mapping->getMapping(
50 'Services/Container',
51 'objs',
52 $a_id
53 )) {
54 $this->link = ilObjectFactory::getInstanceByObjId((int) $new_id, false);
55 if (!$this->link instanceof ilObjLinkResource) {
57 'Invalid id given ' . $a_id
58 );
59 }
60 } else {
61 $this->link = new ilObjLinkResource();
62 $this->link->setType('webr');
63 $this->link->create(true);
64 }
65
66 try {
67 $parser = new ilWebLinkXmlParser($this->link, $a_xml);
68 $parser->setMode(ilWebLinkXmlParser::MODE_CREATE);
69 $parser->start();
70 $a_mapping->addMapping(
71 'Modules/WebResource',
72 'webr',
73 $a_id,
74 (string) $this->link->getId()
75 );
76 } catch (ilSaxParserException $e) {
77 $this->logger->error(
78 ': Parsing failed with message, "' . $e->getMessage() . '".'
79 );
80 } catch (ilWebLinkXMLParserException $e) {
81 $this->logger->error(
82 ': Parsing failed with message, "' . $e->getMessage() . '".'
83 );
84 }
85 }
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)
Class ilObjLinkResource.
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
SaxParserException thrown by ilSaxParser if property throwException is set.
XML parser for weblink xml.

References ilObjectFactory\getInstanceByObjId().

+ Here is the call graph for this function:

Field Documentation

◆ $link

ilObjLinkResource ilWebResourceImporter::$link = null
protected

Definition at line 28 of file class.ilWebResourceImporter.php.

◆ $logger

ilLogger ilWebResourceImporter::$logger
protected

Definition at line 30 of file class.ilWebResourceImporter.php.


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