Open Journal Systems  2.4.8
 All Classes Namespaces Functions Variables Groups Pages
UsageStatsLoader Class Reference
Inheritance diagram for UsageStatsLoader:
FileLoader ScheduledTask

Public Member Functions

 _getAssocFromUrl ($url, $filePath, $lineNumber)
 
 _getCounterRobotListFile ()
 
 _getDataFromLogEntry ($entry)
 
 _getExpectedPageAndOp ()
 
 _getFileType ($assocType, $assocId)
 
 _getInternalArticleId ($id, $journal)
 
 _getInternalIssueId ($id, $journal)
 
 _isLogEntryValid ($entry, $lineNumber)
 
 _loadData ($loadId, &$errorMsg)
 
 autoStage ()
 
 executeActions ()
 
 getName ()
 
 processFile ($filePath, &$errorMsg)
 
 UsageStatsLoader ($args)
 
- Public Member Functions inherited from FileLoader
 _archiveFile ()
 
 _claimNextFile ()
 
 _rejectFile ()
 
 _stageFile ()
 
 checkFolderStructure ($install=false)
 
 executeActions ()
 
 FileLoader ($args)
 
 getArchivePath ()
 
 getCompressArchives ()
 
 getName ()
 
 getProcessingPath ()
 
 getRejectPath ()
 
 getStagePath ()
 
 moveFile ($sourceDir, $destDir, $filename)
 
 processFile ($filePath, &$errorMsg)
 
 setCompressArchives ($compressArchives)
 
- Public Member Functions inherited from ScheduledTask
 addExecutionLogEntry ($message, $type=null)
 
 execute ()
 
 executeActions ()
 
getHelper ()
 
 getName ()
 
 getProcessId ()
 
 ScheduledTask ($args=array())
 

Detailed Description

Scheduled task to extract transform and load usage statistics data into database.

Definition at line 23 of file UsageStatsLoader.inc.php.

Member Function Documentation

UsageStatsLoader::_getAssocFromUrl (   $url,
  $filePath,
  $lineNumber 
)

Get the assoc type and id of the object that is accessed through the passed url.

Parameters
$urlstring
$filePathstring
$lineNumberint
Returns
array

Definition at line 373 of file UsageStatsLoader.inc.php.

References _getExpectedPageAndOp(), _getInternalArticleId(), _getInternalIssueId(), ScheduledTask\addExecutionLogEntry(), Core\getArgs(), Core\getContextPaths(), DAORegistry\getDAO(), Core\getOp(), Core\getPage(), Config\getVar(), and Core\removeBaseUrl().

Referenced by processFile().

UsageStatsLoader::_getCounterRobotListFile ( )

Get the COUNTER robot list file.

Returns
mixed string or false in case of error.

Definition at line 679 of file UsageStatsLoader.inc.php.

Referenced by UsageStatsLoader().

UsageStatsLoader::_getDataFromLogEntry (   $entry)

Get data from the passed log entry.

Parameters
$entrystring
Returns
mixed array

Definition at line 311 of file UsageStatsLoader.inc.php.

Referenced by processFile().

UsageStatsLoader::_getExpectedPageAndOp ( )

Get the expected page and operation from the stats plugin. They are grouped by the object type constant that they give access to.

Returns
array

Definition at line 346 of file UsageStatsLoader.inc.php.

Referenced by _getAssocFromUrl().

UsageStatsLoader::_getFileType (   $assocType,
  $assocId 
)

Get the file type of the object represented by the passed assoc type and id.

Parameters
$assocTypeint
$assocIdint
Returns
int One of the STATISTICS_FILE_TYPE... constants value.

Definition at line 601 of file UsageStatsLoader.inc.php.

References DAORegistry\getDAO().

Referenced by processFile().

UsageStatsLoader::_getInternalArticleId (   $id,
  $journal 
)

Get internal article id.

Parameters
$idstring The id to be used to retrieve the object.
$journalJournal The journal that the article belongs to.
Returns
mixed The internal id if any object was found or false.

Definition at line 555 of file UsageStatsLoader.inc.php.

References DAORegistry\getDAO().

Referenced by _getAssocFromUrl().

UsageStatsLoader::_getInternalIssueId (   $id,
  $journal 
)

Get internal issue id.

Parameters
$idstring The id to be used to retrieve the object.
$journalJournal The journal that the issue belongs to.
Returns
mixed The internal id if any object was found or false.

Definition at line 579 of file UsageStatsLoader.inc.php.

References DAORegistry\getDAO().

Referenced by _getAssocFromUrl().

UsageStatsLoader::_isLogEntryValid (   $entry,
  $lineNumber 
)

Validate a access log entry.

Parameters
$entryarray
Returns
boolean

Definition at line 293 of file UsageStatsLoader.inc.php.

Referenced by processFile().

UsageStatsLoader::_loadData (   $loadId,
$errorMsg 
)

Load the entries inside the temporary database associated with the passed load id to the metrics table.

Parameters
$loadIdstring The current load id. file path.
$errorMsgstring
Returns
boolean Whether or not the process was successful.

Definition at line 659 of file UsageStatsLoader.inc.php.

References DAORegistry\getDAO().

Referenced by processFile().

UsageStatsLoader::autoStage ( )

Auto stage usage stats log files, also moving files that might be in processing folder to stage folder.

Definition at line 251 of file UsageStatsLoader.inc.php.

References FileLoader\getProcessingPath(), FileLoader\getStagePath(), and FileLoader\moveFile().

Referenced by executeActions().

UsageStatsLoader::executeActions ( )
UsageStatsLoader::getName ( )
See Also
FileLoader::getName()

Definition at line 103 of file UsageStatsLoader.inc.php.

UsageStatsLoader::processFile (   $filePath,
$errorMsg 
)

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