ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilSoapDataCollectionAdministration.php
Go to the documentation of this file.
1 <?php
2  /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22  */
23 require_once('./webservice/soap/classes/class.ilSoapAdministration.php');
24 
25 
34 {
35 
47  public function exportDataCollectionContent($sid, $target_ref_id, $table_id = null, $format = ilDclContentExporter::EXPORT_EXCEL, $filepath = null)
48  {
49 
50  $this->initAuth($sid);
51  $this->initIlias();
52  if(!$this->__checkSession($sid))
53  {
54  return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
55  }
56 
57  require_once "Modules/DataCollection/classes/class.ilObjDataCollection.php";
58  if(!$target_obj = new ilObjDataCollection($target_ref_id))
59  {
60  return $this->__raiseError('No valid target given.', 'CLIENT');
61  }
62 
63  if(ilObject::_isInTrash($target_ref_id))
64  {
65  return $this->__raiseError("Parent with ID $target_ref_id has been deleted.",
66  'CLIENT_TARGET_DELETED');
67  }
68 
69  if(!ilObjDataCollectionAccess::hasReadAccess($target_ref_id))
70  {
71  return $this->__raiseError('Check access failed. No permission to read DataCollection',
72  "CLIENT_PERMISSION_ISSUE");
73  }
74 
75  try {
76  require_once "Modules/DataCollection/classes/Content/class.ilDclContentExporter.php";
77  $exporter = new ilDclContentExporter($target_ref_id, $table_id);
78  return $exporter->export($format, $filepath);
79  }
80  catch(ilException $exception) {
81  return $this->__raiseError($exception->getMessage(), $exception->getCode());
82  }
83  }
84 
85 }
86 ?>
Base class for ILIAS Exception handling.
static _isInTrash($a_ref_id)
checks wether object is in trash
__raiseError($a_message, $a_code)
exportDataCollectionContent($sid, $target_ref_id, $table_id=null, $format=ilDclContentExporter::EXPORT_EXCEL, $filepath=null)
Export DataCollection async.
initAuth($sid)
Init authentication.
Hook-Class for exporting data-collections (used in SOAP-Class) This Class avoids duplicated code by r...
Class ilObjDataCollection.