ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSoapDataCollectionAdministration.php
Go to the documentation of this file.
1<?php
23{
29 string $sid,
30 int $target_ref_id,
31 ?int $table_id = null,
33 ?string $filepath = null
34 ) {
35 $this->initAuth($sid);
36 $this->initIlias();
37 if (!$this->checkSession($sid)) {
38 return $this->raiseError($this->getMessage(), $this->getMessageCode());
39 }
40
41 if (!$target_obj = new ilObjDataCollection($target_ref_id)) {
42 return $this->raiseError('No valid target given.', 'CLIENT');
43 }
44
45 if (ilObject::_isInTrash($target_ref_id)) {
46 return $this->raiseError(
47 "Parent with ID $target_ref_id has been deleted.",
48 'CLIENT_TARGET_DELETED'
49 );
50 }
51
52 if (!ilObjDataCollectionAccess::hasReadAccess($target_ref_id)) {
53 return $this->raiseError(
54 'Check access failed. No permission to read DataCollection',
55 "CLIENT_PERMISSION_ISSUE"
56 );
57 }
58
59 try {
60 $exporter = new ilDclContentExporter($target_ref_id, $table_id);
61 return $exporter->export($format, $filepath);
62 } catch (ilException $exception) {
63 return $this->raiseError($exception->getMessage(), $exception->getCode());
64 }
65 }
66}
Hook-Class for exporting data-collections (used in SOAP-Class) This Class avoids duplicated code by r...
Base class for ILIAS Exception handling.
static hasReadAccess(int $ref, ?int $user_id=0)
static _isInTrash(int $ref_id)
raiseError(string $a_message, $a_code)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
exportDataCollectionContent(string $sid, int $target_ref_id, ?int $table_id=null, string $format=ilDclContentExporter::EXPORT_EXCEL, ?string $filepath=null)
Export DataCollection async.