ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilECSCourseSettings.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=0);
20
22
29{
30 protected ilLogger $logger;
31 protected LOMServices $lom_services;
32
33 public function __construct(ilObject $a_content_object)
34 {
35 global $DIC;
36
37 $this->logger = $DIC->logger()->crs();
38 $this->lom_services = $DIC->learningObjectMetadata();
39 parent::__construct($a_content_object);
40 }
41
42 protected function getECSObjectType(): string
43 {
44 return '/campusconnect/courselinks';
45 }
46
47 protected function buildJson(ilECSSetting $a_server)
48 {
49 $json = $this->getJsonCore('application/ecs-course');
50
51 // meta language
52 $lang = $this->lom_services->read(
53 $this->content_obj->getId(),
54 $this->content_obj->getId(),
55 $this->content_obj->getType(),
56 $this->lom_services->paths()->languages()
57 )->firstData($this->lom_services->paths()->languages())->value();
58
59 if (strlen($lang) !== 0) {
60 $json->lang = $lang . '_' . strtoupper($lang);
61 }
62 $json->status = $this->content_obj->isActivated() ? 'online' : 'offline';
63
65 $this->addMetadataToJson($json, $a_server, $definition);
66 $json->courseID = 'il_' . IL_INST_ID . '_' . $this->getContentObject()->getType() . '_' . $this->getContentObject()->getId();
67 return $json;
68 }
69}
Class ilECSCourseSettings.
getECSObjectType()
Get ECS resource identifier, e.g.
buildJson(ilECSSetting $a_server)
Build resource-specific json.
__construct(ilObject $a_content_object)
Constructor.
Handles object exports to ECS.
getContentObject()
Get content object.
getJsonCore(string $a_etype)
Build core json structure.
addMetadataToJson(object $a_json, ilECSSetting $a_server, array $a_definition)
Add advanced metadata to json (export)
static getEContentDefinition(string $a_resource_id)
Get econtent / metadata definition.
Component logger with individual log levels by component id.
Class ilObject Basic functions for all objects.
const IL_INST_ID
Definition: constants.php:40
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26
$lang
Definition: xapiexit.php:25