ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilWebResourceImporter Class Reference
+ 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

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

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

Constructor & Destructor Documentation

◆ __construct()

ilWebResourceImporter::__construct ( )

Reimplemented from ilXmlImporter.

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

31 {
32 global $DIC;
33
35 $this->logger = $DIC->logger()->webr();
36 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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 41 of file class.ilWebResourceImporter.php.

46 : void {
47 if ($new_id = $a_mapping->getMapping(
48 'components/ILIAS/Container',
49 'objs',
50 $a_id
51 )) {
52 $this->link = ilObjectFactory::getInstanceByObjId((int) $new_id, false);
53 if (!$this->link instanceof ilObjLinkResource) {
55 'Invalid id given ' . $a_id
56 );
57 }
58 } else {
59 $this->link = new ilObjLinkResource();
60 $this->link->setType('webr');
61 $this->link->create();
62 }
63
64 try {
65 $parser = new ilWebLinkXmlParser($this->link, $a_xml);
66 $parser->setMode(ilWebLinkXmlParser::MODE_CREATE);
67 $parser->start();
68 $a_mapping->addMapping(
69 'components/ILIAS/WebResource',
70 'webr',
71 $a_id,
72 (string) $this->link->getId()
73 );
74
75 $a_mapping->addMapping(
76 'components/ILIAS/MetaData',
77 'md',
78 $a_id . ':0:webr',
79 $this->link->getId() . ':0:webr'
80 );
81 } catch (ilSaxParserException $e) {
82 $this->logger->error(
83 ': Parsing failed with message, "' . $e->getMessage() . '".'
84 );
85 } catch (ilWebLinkXMLParserException $e) {
86 $this->logger->error(
87 ': Parsing failed with message, "' . $e->getMessage() . '".'
88 );
89 }
90 }
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)
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...
link(string $caption, string $href, bool $new_viewport=false)

References ilObjectFactory\getInstanceByObjId(), and ILIAS\Repository\link().

+ Here is the call graph for this function:

Field Documentation

◆ $link

ilObjLinkResource ilWebResourceImporter::$link = null
protected

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

◆ $logger

ilLogger ilWebResourceImporter::$logger
protected

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


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