ILIAS
Release_4_4_x_branch Revision 61816
|
Class ilChangeEvent tracks change events on repository objects. More...
Public Member Functions | |
_recordWriteEvent ($obj_id, $usr_id, $action, $parent_obj_id=null) | |
Records a write event. | |
_recordReadEvent ($a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false) | |
Records a read event and catches up with write events. | |
_recordObjStats ($a_obj_id, $a_spent_seconds, $a_read_count, $a_childs_spent_seconds=null, $a_child_read_count=null) | |
_syncObjectStats ($a_now=null, $a_minimum=20000) | |
Process object statistics log data. | |
_catchupWriteEvents ($obj_id, $usr_id, $timestamp=null) | |
Catches up with all write events which occured before the specified timestamp. | |
_updateAccessForScormOfflinePlayer ($obj_id, $usr_id, $i_last_access, $t_first_access) | |
_updateAccessForScormOfflinePlayer needed to synchronize last_access and first_access when learning modul is used offline called in . |
Static Public Member Functions | |
static | _lookupUncaughtWriteEvents ($obj_id, $usr_id) |
Catches up with all write events which occured before the specified timestamp. | |
static | _lookupChangeState ($obj_id, $usr_id) |
Returns the change state of the object for the specified user. | |
static | _lookupInsideChangeState ($parent_obj_id, $usr_id) |
Returns the changed state of objects which are children of the specified parent object. | |
static | _lookupReadEvents ($obj_id, $usr_id=null) |
Reads all read events which occured on the object which happened after the last time the user caught up with them. | |
static | lookupUsersInProgress ($a_obj_id) |
Lookup users in progress. | |
static | hasAccessed ($a_obj_id, $a_usr_id) |
Has accessed. | |
static | _activate () |
Activates change event tracking. | |
static | _deactivate () |
Deactivates change event tracking. | |
static | _isActive () |
Returns true, if change event tracking is active. | |
static | _delete ($a_obj_id) |
Delete object entries. | |
static | _deleteReadEvents ($a_obj_id) |
static | _deleteReadEventsForUsers ($a_obj_id, array $a_user_ids) |
static | _getAllUserIds ($a_obj_id) |
Static Private Attributes | |
static | $has_accessed = array() |
Class ilChangeEvent tracks change events on repository objects.
The following events are considered to be a 'write event':
The following events are considered to be a 'read event':
*reading the content of a container using WebDAV is not counted, because WebDAV clients can't see all objects in a container.
A user can catch up with write events, by calling __catchupWriteEvents(...).
A user can query, if an object has changed, since the last time he has caught up with write events, by calling _lookupUncaughtWriteEvents(...).
Definition at line 36 of file class.ilChangeEvent.php.
|
static |
Activates change event tracking.
Definition at line 849 of file class.ilChangeEvent.php.
References $query, $res, and _isActive().
Referenced by ilObjRepositorySettingsGUI\saveSettings(), and ilTrackingTest\testChangeEvent().
ilChangeEvent::_catchupWriteEvents | ( | $obj_id, | |
$usr_id, | |||
$timestamp = null |
|||
) |
Catches up with all write events which occured before the specified timestamp.
$obj_id | int The object. |
$usr_id | int The user. |
$timestamp | SQL timestamp. |
Definition at line 456 of file class.ilChangeEvent.php.
References $query, $res, $timestamp, and $usr_id.
Referenced by _recordReadEvent(), ilContainerGUI\pasteObject(), ilContainerGUI\performPasteIntoMultipleObjectsObject(), ilDAVServer\PUT(), ilRepUtil\restoreObjects(), ilObjFileGUI\update(), ilObjRootFolderGUI\updateObject(), ilObjGroupGUI\updateObject(), ilObjCategoryGUI\updateObject(), and ilObjCourseGUI\updateObject().
|
static |
Deactivates change event tracking.
Definition at line 906 of file class.ilChangeEvent.php.
Referenced by ilObjRepositorySettingsGUI\saveSettings(), and ilTrackingTest\testChangeEvent().
|
static |
Delete object entries.
Definition at line 929 of file class.ilChangeEvent.php.
References $query.
Referenced by ilObjectLP\handleDelete().
|
static |
Definition at line 943 of file class.ilChangeEvent.php.
|
static |
Definition at line 951 of file class.ilChangeEvent.php.
Referenced by ilObjectLP\resetLPDataForUserIds().
|
static |
Definition at line 960 of file class.ilChangeEvent.php.
Referenced by ilObjectLP\gatherLPUsers().
|
static |
Returns true, if change event tracking is active.
Definition at line 917 of file class.ilChangeEvent.php.
Referenced by ilObjUserTracking\__readSettings(), _activate(), ilInfoScreenGUI\addObjectSections(), ilObjRepositorySettingsGUI\addToExternalSettingsForm(), ilObjectListGUI\getProperties(), and ilObjRepositorySettingsGUI\initSettingsForm().
|
static |
Returns the change state of the object for the specified user.
which happened after the last time the user caught up with them.
$obj_id | int The object |
$usr_id | int The user who is interested into these events. |
Definition at line 603 of file class.ilChangeEvent.php.
References $query, $res, $row, $usr_id, and DB_FETCHMODE_ASSOC.
Referenced by ilObjectListGUI\getProperties(), and ilTrackingTest\testChangeEvent().
|
static |
Returns the changed state of objects which are children of the specified parent object.
Note this gives a different result than calling _lookupChangeState of each child object. This is because, this function treats a catch on the write events on the parent as a catch up for all child objects. This difference was made, because it greatly improves performance of this function.
$parent_obj_id | int The object id of the parent object. |
$usr_id | int The user who is interested into these events. |
Definition at line 668 of file class.ilChangeEvent.php.
References $query, $res, $row, $usr_id, and DB_FETCHMODE_ASSOC.
Referenced by ilObjectListGUI\getProperties(), and ilTrackingTest\testChangeEvent().
|
static |
Reads all read events which occured on the object which happened after the last time the user caught up with them.
NOTE: THIS FUNCTION NEEDS TO BE REWRITTEN. READ EVENTS ARE OF INTEREST AT REF_ID's OF OBJECTS.
$obj_id | int The object |
$usr_id | int The user who is interested into these events. / public static function _lookupUncaughtReadEvents($obj_id, $usr_id) { global $ilDB; |
$q = "SELECT ts ". "FROM catch_read_events ". "WHERE obj_id=".$ilDB->quote($obj_id)." ". "AND usr_id=".$ilDB->quote($usr_id); $r = $ilDB->query($q); $catchup = null; while ($row = $r->fetchRow(DB_FETCHMODE_ASSOC)) { $catchup = $row['ts']; }
$q = "SELECT * ". "FROM read_event ". "WHERE obj_id=".$ilDB->quote($obj_id)." ". ($catchup == null ? "" : "AND last_access > ".$ilDB->quote($catchup))." ". ($catchup == null ? "" : "AND last_access > ".$ilDB->quote($catchup))." ". "ORDER BY last_access DESC"; $r = $ilDB->query($q); $events = array(); while ($row = $r->fetchRow(DB_FETCHMODE_ASSOC)) { $events[] = $row; } return $events; } Reads all read events which occured on the object.
$obj_id | int The object |
$usr_id | int Optional, the user who performed these events. |
Definition at line 761 of file class.ilChangeEvent.php.
References $query, $res, $row, and $usr_id.
Referenced by ilLPStatusVisits\_getCompleted(), ilLPStatusTypicalLearningTime\_getCompleted(), ilLPStatusVisits\_getInProgress(), ilLPStatusTypicalLearningTime\_getInProgress(), ilLearningProgress\_getProgress(), ilLearningProgress\_lookupProgressByObjId(), ilInfoScreenGUI\addObjectSections(), ilLPStatusVisits\determinePercentage(), ilLPStatusTypicalLearningTime\determinePercentage(), ilLPStatusVisits\determineStatus(), ilLPStatusTypicalLearningTime\determineStatus(), and ilSCORMOfflineMode\il2sopSahsUser().
|
static |
Catches up with all write events which occured before the specified timestamp.
THIS FUNCTION IS CURRENTLY NOT IN USE. BEFORE IT CAN BE USED, THE TABLE catch_read_events MUST BE CREATED.
$obj_id | int The object. |
$usr_id | int The user. |
$timestamp | SQL timestamp. / function _catchupReadEvents($obj_id, $usr_id, $timestamp = null) { global $ilDB; |
$q = "INSERT INTO catch_read_events ". "(obj_id, usr_id, action, ts) ". "VALUES (". $ilDB->quote($obj_id).",". $ilDB->quote($usr_id).",". $ilDB->quote('read').","; if ($timestamp == null) { $q .= "NOW()". ") ON DUPLICATE KEY UPDATE ts=NOW()"; } else { $q .= $ilDB->quote($timestamp). ") ON DUPLICATE KEY UPDATE ts=".$ilDB->quote($timestamp); }
$r = $ilDB->query($q); } Reads all write events which occured on the object which happened after the last time the user caught up with them.
$obj_id | int The object |
$usr_id | int The user who is interested into these events. |
Definition at line 550 of file class.ilChangeEvent.php.
References $query, $res, $row, $usr_id, and DB_FETCHMODE_ASSOC.
Referenced by ilTrackingTest\testChangeEvent().
ilChangeEvent::_recordObjStats | ( | $a_obj_id, | |
$a_spent_seconds, | |||
$a_read_count, | |||
$a_childs_spent_seconds = null , |
|||
$a_child_read_count = null |
|||
) |
Definition at line 292 of file class.ilChangeEvent.php.
References ilObjUserTracking\_enabledObjectStatistics(), ilObject\_lookupType(), and _syncObjectStats().
Referenced by _recordReadEvent().
ilChangeEvent::_recordReadEvent | ( | $a_type, | |
$a_ref_id, | |||
$obj_id, | |||
$usr_id, | |||
$isCatchupWriteEvents = true , |
|||
$a_ext_rc = false , |
|||
$a_ext_time = false |
|||
) |
Records a read event and catches up with write events.
$obj_id | int The object which was read. |
$usr_id | int The user who performed a read action. |
$catchupWriteEvents | boolean If true, this function catches up with write events. |
Definition at line 113 of file class.ilChangeEvent.php.
References $path, $query, $res, $row, $usr_id, _catchupWriteEvents(), ilObjUserTracking\_getValidTimeSpan(), ilObject\_lookupObjId(), ilObject\_lookupType(), and _recordObjStats().
Referenced by ilLicense\_noteAccess(), ilObjSCORMTracking\_syncReadEvent(), ilSCORM2004Tracking\_syncReadEvent(), ilLearningProgress\_tracProgress(), ilDAVServer\COPY(), ilDAVServer\GET(), ilWikiPageGUI\increaseViewCount(), ilObjSessionGUI\infoScreen(), ilContainerGUI\performPasteIntoMultipleObjectsObject(), ilDAVServer\PROPFIND(), ilObjLinkResourceGUI\redirectToLink(), ilObjFileGUI\sendFile(), ilContainerContentGUI\setOutput(), ilObjSCORMTracking\syncGlobalStatus(), ilSCORM2004StoreData\syncGlobalStatus(), ilCourseContentGUI\view(), and ilObjectGUI\viewObject().
ilChangeEvent::_recordWriteEvent | ( | $obj_id, | |
$usr_id, | |||
$action, | |||
$parent_obj_id = null |
|||
) |
Records a write event.
The parent object should be specified for the 'delete', 'undelete' and 'add' and 'remove' events.
$obj_id | int The object which was written to. |
$usr_id | int The user who performed a write action. |
$action | string The name of the write action. 'create', 'update', 'delete', 'add', 'remove', 'undelete'. |
$parent_obj_id | int The object id of the parent object. If this is null, then the event is recorded for all parents of the object. If this is not null, then the event is only recorded for the specified parent. |
Definition at line 55 of file class.ilChangeEvent.php.
References $query, and $usr_id.
Referenced by ilObjCourseGUI\afterSave(), ilDAVServer\COPY(), ilDAVServer\DELETE(), ilObjFileGUI\handleFileUpload(), ilDAVServer\MKCOL(), ilDAVServer\MOVE(), ilContainerGUI\pasteObject(), ilContainerGUI\performPasteIntoMultipleObjectsObject(), ilDAVServer\PUT(), ilObject2GUI\putObjectInTree(), ilObjectGUI\putObjectInTree(), ilRepUtil\removeObjectsFromSystem(), ilRepUtil\restoreObjects(), ilObjFileGUI\save(), ilObjFileGUI\update(), ilObjRootFolderGUI\updateObject(), ilObjGroupGUI\updateObject(), ilObjCategoryGUI\updateObject(), and ilObjCourseGUI\updateObject().
ilChangeEvent::_syncObjectStats | ( | $a_now = null , |
|
$a_minimum = 20000 |
|||
) |
Process object statistics log data.
integer | $a_now | |
integer | $a_minimum |
Definition at line 343 of file class.ilChangeEvent.php.
References $row, and ilDB\LOCK_WRITE.
Referenced by _recordObjStats(), and ilLPObjectStatisticsGUI\adminSync().
ilChangeEvent::_updateAccessForScormOfflinePlayer | ( | $obj_id, | |
$usr_id, | |||
$i_last_access, | |||
$t_first_access | |||
) |
_updateAccessForScormOfflinePlayer needed to synchronize last_access and first_access when learning modul is used offline called in .
/Modules/ScormAicc/classes/class.ilSCORMOfflineMode.php
Definition at line 982 of file class.ilChangeEvent.php.
Referenced by ilSCORMOfflineMode\scormPlayerUnloadForSop2il().
|
static |
Has accessed.
Definition at line 824 of file class.ilChangeEvent.php.
Referenced by ilLPStatusManual\determineStatus(), ilLPStatusVisits\determineStatus(), ilLPStatusTypicalLearningTime\determineStatus(), ilLPStatusExerciseReturned\determineStatus(), ilLPStatusObjectives\determineStatus(), ilLPStatusManualByTutor\determineStatus(), ilLPStatusSCORM\determineStatus(), and ilLPStatusCollection\determineStatus().
|
static |
Lookup users in progress.
Definition at line 806 of file class.ilChangeEvent.php.
References $query, $res, and $row.
Referenced by ilLPStatusManual\_getInProgress(), ilLPStatusObjectives\_getInProgress(), ilLPStatusExerciseReturned\_getInProgress(), ilLPStatusCollection\_getInProgress(), and ilLPStatusManualByTutor\_getInProgress().
|
staticprivate |
Definition at line 38 of file class.ilChangeEvent.php.