ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilECSExport Class Reference

Storage of ECS exported objects. More...

+ Collaboration diagram for ilECSExport:

Public Member Functions

 __construct ($a_server_id, $a_obj_id)
 Constructor. More...
 
 getServerId ()
 Get server id. More...
 
 setServerId ($a_server_id)
 Set server id. More...
 
 setExported ($a_status)
 Set exported. More...
 
 isExported ()
 check if an object is exported or not More...
 
 setEContentId ($a_id)
 set econtent id More...
 
 getEContentId ()
 get econtent id More...
 
 save ()
 Save. More...
 

Static Public Member Functions

static _isExported ($a_obj_id)
 Check if object is exported. More...
 
static _getAllEContentIds ($a_server_id)
 get all exported econtent ids per server More...
 
static getExportedIds ()
 Get exported ids ilDB $ilDB. More...
 
static getExportedIdsByType ($a_type)
 Get exported ids by type ilDB $ilDB. More...
 
static getExportServerIds ($a_obj_id)
 lookup server ids of exported materials ilDB $ilDB More...
 
static _getExportedIDsByServer ($a_server_id)
 get exported ids for server More...
 
static lookupServerIds ($a_obj_id)
 Lookup server ids of exported objects ilDB $ilDB. More...
 
static _deleteEContentIds ($a_server_id, $a_ids)
 Delete econtent ids for server. More...
 
static deleteByServer ($a_server_id)
 Delete by server id ilDB $ilDB. More...
 
static _isRemote ($a_server_id, $a_econtent_id)
 is remote object More...
 
static deleteByServerId ($a_server_id)
 

Protected Attributes

 $db = null
 
 $server_id = 0
 
 $obj_id = 0
 
 $econtent_id = 0
 
 $exported = false
 

Private Member Functions

 read ()
 Read private. More...
 

Detailed Description

Storage of ECS exported objects.

This class stores the econent id and informations whether an object is exported or not.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 34 of file class.ilECSExport.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSExport::__construct (   $a_server_id,
  $a_obj_id 
)

Constructor.

public

Parameters

Definition at line 50 of file class.ilECSExport.php.

References $DIC, $ilDB, and read().

51  {
52  global $DIC;
53 
54  $ilDB = $DIC['ilDB'];
55 
56  $this->server_id = $a_server_id;
57  $this->obj_id = $a_obj_id;
58 
59  $this->db = $ilDB;
60  $this->read();
61  }
global $DIC
Definition: saml.php:7
read()
Read private.
global $ilDB
+ Here is the call graph for this function:

Member Function Documentation

◆ _deleteEContentIds()

static ilECSExport::_deleteEContentIds (   $a_server_id,
  $a_ids 
)
static

Delete econtent ids for server.

public

Parameters
arrayarray of econtent ids

Definition at line 237 of file class.ilECSExport.php.

References $DIC, $ilDB, $query, and $res.

Referenced by ilECSEventQueueReader\handleExportReset().

238  {
239  global $DIC;
240 
241  $ilDB = $DIC['ilDB'];
242 
243  if (!is_array($a_ids) or !count($a_ids)) {
244  return true;
245  }
246  #$query = "DELETE FROM ecs_export WHERE econtent_id IN (".implode(',',ilUtil::quoteArray($a_ids)).')';
247  $query = "DELETE FROM ecs_export WHERE " . $ilDB->in('econtent_id', $a_ids, false, 'integer') . ' ' .
248  'AND server_id = ' . $ilDB->quote($a_server_id, 'integer');
249  $res = $ilDB->manipulate($query);
250  return true;
251  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ _getAllEContentIds()

static ilECSExport::_getAllEContentIds (   $a_server_id)
static

get all exported econtent ids per server

public

Definition at line 109 of file class.ilECSExport.php.

References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSEventQueueReader\handleExportReset().

110  {
111  global $DIC;
112 
113  $ilDB = $DIC['ilDB'];
114 
115  $query = "SELECT econtent_id,obj_id FROM ecs_export " .
116  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer');
117 
118  $res = $ilDB->query($query);
119  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
120  $econtent_ids[$row->econtent_id] = $row->obj_id;
121  }
122  return $econtent_ids ? $econtent_ids : array();
123  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ _getExportedIDsByServer()

static ilECSExport::_getExportedIDsByServer (   $a_server_id)
static

get exported ids for server

public

Returns

Definition at line 193 of file class.ilECSExport.php.

References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

194  {
195  global $DIC;
196 
197  $ilDB = $DIC['ilDB'];
198  $query = "SELECT obj_id FROM ecs_export " .
199  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer');
200  $res = $ilDB->query($query);
201  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
202  $obj_ids[] = $row->obj_id;
203  }
204  return $obj_ids ? $obj_ids : array();
205  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ _isExported()

static ilECSExport::_isExported (   $a_obj_id)
static

Check if object is exported.

Parameters
int$a_obj_id
Returns
bool

Definition at line 86 of file class.ilECSExport.php.

References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSObjectSettings\addSettingsToForm().

87  {
88  global $DIC;
89 
90  $ilDB = $DIC['ilDB'];
91 
92  $query = 'SELECT * FROM ecs_export ' .
93  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
94  $res = $ilDB->query($query);
95  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
96  return true;
97  }
98  return false;
99  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ _isRemote()

static ilECSExport::_isRemote (   $a_server_id,
  $a_econtent_id 
)
static

is remote object

public

Parameters
intecontent_id

Definition at line 277 of file class.ilECSExport.php.

References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilObjRemoteCategoryListGUI\getCommandFrame(), ilObjRemoteCourseListGUI\getCommandFrame(), ilObjRemoteGlossaryListGUI\getCommandFrame(), ilObjRemoteTestListGUI\getCommandFrame(), ilObjRemoteWikiListGUI\getCommandFrame(), ilObjRemoteGroupListGUI\getCommandFrame(), ilObjRemoteLearningModuleListGUI\getCommandFrame(), ilObjRemoteFileListGUI\getCommandFrame(), and ilRemoteObjectBase\isLocalObject().

278  {
279  global $DIC;
280 
281  $ilDB = $DIC['ilDB'];
282 
283  $query = "SELECT obj_id FROM ecs_export " .
284  "WHERE econtent_id = " . $ilDB->quote($a_econtent_id, 'integer') . " " .
285  'AND server_id = ' . $ilDB->quote($a_server_id, 'integer');
286  $res = $ilDB->query($query);
287  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
288  return false;
289  }
290  return true;
291  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ deleteByServer()

static ilECSExport::deleteByServer (   $a_server_id)
static

Delete by server id ilDB $ilDB.

Parameters
int$a_server_id

Definition at line 258 of file class.ilECSExport.php.

References $DIC, $ilDB, and $query.

Referenced by ilECSSettingsGUI\doDelete().

259  {
260  global $DIC;
261 
262  $ilDB = $DIC['ilDB'];
263 
264  $query = 'DELETE FROM ecs_export ' .
265  'WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer');
266  $ilDB->manipulate($query);
267  }
global $DIC
Definition: saml.php:7
$query
global $ilDB
+ Here is the caller graph for this function:

◆ deleteByServerId()

static ilECSExport::deleteByServerId (   $a_server_id)
static

Definition at line 389 of file class.ilECSExport.php.

References $DIC, $ilDB, and $query.

Referenced by ilECSSetting\delete().

390  {
391  global $DIC;
392 
393  $ilDB = $DIC['ilDB'];
394 
395  $query = 'DELETE FROM ecs_export' .
396  ' WHERE server_id = ' . $ilDB->quote($a_server_id, 'integer');
397  $ilDB->manipulate($query);
398  return true;
399  }
global $DIC
Definition: saml.php:7
$query
global $ilDB
+ Here is the caller graph for this function:

◆ getEContentId()

ilECSExport::getEContentId ( )

get econtent id

public

Returns
int econtent id

Definition at line 335 of file class.ilECSExport.php.

References $econtent_id.

Referenced by ilECSObjectSettings\doDelete(), ilECSObjectSettings\doUpdate(), and save().

336  {
337  return $this->econtent_id;
338  }
+ Here is the caller graph for this function:

◆ getExportedIds()

static ilECSExport::getExportedIds ( )
static

Get exported ids ilDB $ilDB.

Returns
array

Definition at line 130 of file class.ilECSExport.php.

References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSObjectSettings\_handleDelete(), and ilECSSettingsGUI\exportReleased().

131  {
132  global $DIC;
133 
134  $ilDB = $DIC['ilDB'];
135  $query = "SELECT obj_id FROM ecs_export ";
136  $res = $ilDB->query($query);
137  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
138  $obj_ids[] = $row->obj_id;
139  }
140  return $obj_ids ? $obj_ids : array();
141  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ getExportedIdsByType()

static ilECSExport::getExportedIdsByType (   $a_type)
static

Get exported ids by type ilDB $ilDB.

Returns
array

Definition at line 148 of file class.ilECSExport.php.

References $a_type, $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSSettingsGUI\released().

149  {
150  global $DIC;
151 
152  $ilDB = $DIC['ilDB'];
153  $query = "SELECT e.obj_id FROM ecs_export e" .
154  " JOIN object_data o ON (e.obj_id = o.obj_id)" .
155  " WHERE o.type = " . $ilDB->quote($a_type, "text");
156  $res = $ilDB->query($query);
157  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
158  $obj_ids[] = $row->obj_id;
159  }
160  return $obj_ids ? $obj_ids : array();
161  }
global $DIC
Definition: saml.php:7
$a_type
Definition: workflow.php:92
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ getExportServerIds()

static ilECSExport::getExportServerIds (   $a_obj_id)
static

lookup server ids of exported materials ilDB $ilDB

Parameters
int$a_obj_id
Returns
array

Definition at line 169 of file class.ilECSExport.php.

References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSObjectSettings\_handleDelete(), ilECSObjectSettings\addSettingsToForm(), and ilECSObjectSettings\handleContentUpdate().

170  {
171  global $DIC;
172 
173  $ilDB = $DIC['ilDB'];
174 
175  $query = 'SELECT * FROM ecs_export ' .
176  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
177  $res = $ilDB->query($query);
178 
179  $sids = array();
180  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
181  $sids[] = $row->server_id;
182  }
183  return $sids;
184  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ getServerId()

ilECSExport::getServerId ( )

Get server id.

Returns
int

Definition at line 67 of file class.ilECSExport.php.

References $server_id.

Referenced by read(), and save().

68  {
69  return $this->server_id;
70  }
+ Here is the caller graph for this function:

◆ isExported()

ilECSExport::isExported ( )

check if an object is exported or not

public

Definition at line 311 of file class.ilECSExport.php.

References $exported.

Referenced by ilECSObjectSettings\doDelete(), and save().

312  {
313  return (bool) $this->exported;
314  }
+ Here is the caller graph for this function:

◆ lookupServerIds()

static ilECSExport::lookupServerIds (   $a_obj_id)
static

Lookup server ids of exported objects ilDB $ilDB.

Parameters
<type>$a_obj_id
Returns
<type>

Definition at line 213 of file class.ilECSExport.php.

References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSReleasedContentTableGUI\parse().

214  {
215  global $DIC;
216 
217  $ilDB = $DIC['ilDB'];
218 
219  $query = 'SELECT * FROM ecs_export ' .
220  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer') . ' ';
221  $res = $ilDB->query($query);
222  $sids = array();
223  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
224  $sids[] = $row->server_id;
225  }
226  return $sids;
227  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilECSExport::read ( )
private

Read private.

Definition at line 373 of file class.ilECSExport.php.

References $DIC, $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, and getServerId().

Referenced by __construct().

374  {
375  global $DIC;
376 
377  $ilDB = $DIC['ilDB'];
378 
379  $query = "SELECT * FROM ecs_export WHERE " .
380  "obj_id = " . $this->db->quote($this->obj_id, 'integer') . " AND " .
381  'server_id = ' . $ilDB->quote($this->getServerId(), 'integer');
382  $res = $this->db->query($query);
383  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
384  $this->econtent_id = $row->econtent_id;
385  $this->exported = true;
386  }
387  }
global $DIC
Definition: saml.php:7
getServerId()
Get server id.
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilECSExport::save ( )

Save.

public

Definition at line 345 of file class.ilECSExport.php.

References $DIC, $ilDB, $query, $res, getEContentId(), getServerId(), and isExported().

Referenced by ilECSObjectSettings\doAdd(), and ilECSObjectSettings\doDelete().

346  {
347  global $DIC;
348 
349  $ilDB = $DIC['ilDB'];
350 
351  $query = "DELETE FROM ecs_export " .
352  "WHERE obj_id = " . $this->db->quote($this->obj_id, 'integer') . " " .
353  'AND server_id = ' . $ilDB->quote($this->getServerId());
354  $res = $ilDB->manipulate($query);
355 
356  if ($this->isExported()) {
357  $query = "INSERT INTO ecs_export (server_id,obj_id,econtent_id) " .
358  "VALUES ( " .
359  $this->db->quote($this->getServerId(), 'integer') . ', ' .
360  $this->db->quote($this->obj_id, 'integer') . ", " .
361  $this->db->quote($this->getEContentId(), 'integer') . " " .
362  ")";
363  $res = $ilDB->manipulate($query);
364  }
365 
366  return true;
367  }
global $DIC
Definition: saml.php:7
getServerId()
Get server id.
foreach($_POST as $key=> $value) $res
isExported()
check if an object is exported or not
getEContentId()
get econtent id
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setEContentId()

ilECSExport::setEContentId (   $a_id)

set econtent id

public

Parameters
intecontent id (received from ECS::addResource)

Definition at line 323 of file class.ilECSExport.php.

Referenced by ilECSObjectSettings\doAdd().

324  {
325  $this->econtent_id = $a_id;
326  }
+ Here is the caller graph for this function:

◆ setExported()

ilECSExport::setExported (   $a_status)

Set exported.

public

Parameters
boolexport status

Definition at line 300 of file class.ilECSExport.php.

Referenced by ilECSObjectSettings\doAdd(), and ilECSObjectSettings\doDelete().

301  {
302  $this->exported = $a_status;
303  }
+ Here is the caller graph for this function:

◆ setServerId()

ilECSExport::setServerId (   $a_server_id)

Set server id.

Parameters
int$a_server_id

Definition at line 76 of file class.ilECSExport.php.

77  {
78  $this->server_id = $a_server_id;
79  }

Field Documentation

◆ $db

ilECSExport::$db = null
protected

Definition at line 36 of file class.ilECSExport.php.

◆ $econtent_id

ilECSExport::$econtent_id = 0
protected

Definition at line 40 of file class.ilECSExport.php.

Referenced by getEContentId().

◆ $exported

ilECSExport::$exported = false
protected

Definition at line 41 of file class.ilECSExport.php.

Referenced by isExported().

◆ $obj_id

ilECSExport::$obj_id = 0
protected

Definition at line 39 of file class.ilECSExport.php.

◆ $server_id

ilECSExport::$server_id = 0
protected

Definition at line 38 of file class.ilECSExport.php.

Referenced by getServerId().


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