ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilECSCourseSettings.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once 'Services/WebServices/ECS/classes/class.ilECSObjectSettings.php';
6
16{
17 protected function getECSObjectType()
18 {
19 return '/campusconnect/courselinks';
20 }
21
22 protected function buildJson(ilECSSetting $a_server)
23 {
24 global $ilLog;
25
26 $json = $this->getJsonCore('application/ecs-course');
27
28 // meta language
29 include_once('./Services/MetaData/classes/class.ilMDLanguage.php');
30 $lang = ilMDLanguage::_lookupFirstLanguage($this->content_obj->getId(), $this->content_obj->getId(), $this->content_obj->getType());
31 if (strlen($lang)) {
32 $json->lang = $lang . '_' . strtoupper($lang);
33 }
34
35 $json->status = $this->content_obj->isActivated() ? 'online' : 'offline';
36
37 include_once('./Services/WebServices/ECS/classes/class.ilECSUtils.php');
39 $this->addMetadataToJson($json, $a_server, $definition);
40
41 $json->courseID = 'il_' . IL_INST_ID . '_' . $this->getContentObject()->getType() . '_' . $this->getContentObject()->getId();
42
43 return $json;
44 }
45}
An exception for terminatinating execution or to throw for unit testing.
Class ilECSCourseSettings.
getECSObjectType()
Get ECS resource identifier, e.g.
buildJson(ilECSSetting $a_server)
Build resource-specific json.
Handles object exports to ECS.
getContentObject()
Get content object.
getJsonCore($a_etype)
Build core json structure.
addMetadataToJson(&$a_json, ilECSSetting $a_server, array $a_definition)
Add advanced metadata to json (export)
static getEContentDefinition($a_resource_id)
Get econtent / metadata definition.
static _lookupFirstLanguage($a_rbac_id, $a_obj_id, $a_obj_type)
Lookup first language.
$lang
Definition: consent.php:3