Open Journal Systems  3.3.0
PKPStatsPublicationHandler Class Reference
Inheritance diagram for PKPStatsPublicationHandler:
APIHandler PKPHandler StatsPublicationHandler

Public Member Functions

 __construct ()
 
 authorize ($request, &$args, $roleAssignments)
 
 get ($slimRequest, $response, $args)
 
 getAbstract ($slimRequest, $response, $args)
 
 getGalley ($slimRequest, $response, $args)
 
 getMany ($slimRequest, $response, $args)
 
 getManyAbstract ($slimRequest, $response, $args)
 
 getManyGalley ($slimRequest, $response, $args)
 
- Public Member Functions inherited from APIHandler
 convertStringsToSchema ($schema, $params)
 
 getApp ()
 
 getEndpointPattern ()
 
 getEndpoints ()
 
 getEntityId ($parameterName)
 
 getParameter ($parameterName, $default=null)
 
 getRequest ()
 
 getSlimRequest ()
 
 setSlimRequest ($slimRequest)
 
 setupEndpoints ()
 
- Public Member Functions inherited from PKPHandler
 addPolicy ($authorizationPolicy, $addToTop=false)
 
 addRoleAssignment ($roleIds, $operations)
 
 getApiToken ()
 
getAuthorizedContext ()
 
getAuthorizedContextObject ($assocType)
 
getDispatcher ()
 
 getFirstUserContext ($user, $contexts)
 
 getId ()
 
 getLastAuthorizationMessage ()
 
 getRoleAssignment ($roleId)
 
 getRoleAssignments ()
 
 getSiteRedirectContext ($request)
 
 getTargetContext ($request, &$contextsCount=null)
 
 index ($args, $request)
 
 initialize ($request)
 
 markRoleAssignmentsChecked ()
 
 requireSSL ()
 
 setApiToken ($apiToken)
 
 setDispatcher ($dispatcher)
 
 setEnforceRestrictedSite ($enforceRestrictedSite)
 
 setId ($id)
 
 setupTemplate ($request)
 
 validate ($requiredContexts=null, $request=null)
 

Protected Member Functions

 _processAllowedParams ($requestParams, $allowedParams)
 
 _processSearchPhrase ($searchPhrase, $submissionIds=[])
 
- Protected Member Functions inherited from APIHandler
 _validateStatDates ($params, $dateStartParam='dateStart', $dateEndParam='dateEnd')
 

Additional Inherited Members

- Static Public Member Functions inherited from PKPHandler
static getPageParamName ($rangeName)
 
static getRangeInfo ($request, $rangeName, $contextData=null)
 
static hashPageContext ($request, $contextData=array())
 
- Data Fields inherited from PKPHandler
 $_authorizationDecisionManager
 
 $_checks = array()
 
 $_dispatcher
 
 $_enforceRestrictedSite = true
 
 $_id
 
 $_isBackendPage = false
 
 $_roleAssignments = array()
 
 $_roleAssignmentsChecked = false
 
- Protected Attributes inherited from APIHandler
 $_app
 
 $_endpoints = array()
 
 $_handlerPath = null
 
 $_pathPattern
 
 $_request
 
 $_slimRequest = null
 
- Protected Attributes inherited from PKPHandler
 $_apiToken = null
 

Detailed Description

Handle API requests for publication statistics.

Definition at line 22 of file PKPStatsPublicationHandler.inc.php.

Constructor & Destructor Documentation

◆ __construct()

PKPStatsPublicationHandler::__construct ( )

Constructor

Reimplemented from APIHandler.

Definition at line 27 of file PKPStatsPublicationHandler.inc.php.

References APIHandler\getEndpointPattern().

Member Function Documentation

◆ _processAllowedParams()

PKPStatsPublicationHandler::_processAllowedParams (   $requestParams,
  $allowedParams 
)
protected

A helper method to filter and sanitize the request params

Only allows the specified params through and enforces variable type where needed.

Parameters
array$requestParams
array$allowedParams
Returns
array

Definition at line 578 of file PKPStatsPublicationHandler.inc.php.

References PKPServices\get(), PKPHandler\getId(), and APIHandler\getRequest().

Referenced by get(), getAbstract(), getGalley(), getMany(), getManyAbstract(), and getManyGalley().

◆ _processSearchPhrase()

PKPStatsPublicationHandler::_processSearchPhrase (   $searchPhrase,
  $submissionIds = [] 
)
protected

A helper method to get the submissionIds param when a searchPhase param is also passed.

If the searchPhrase and submissionIds params were both passed in the request, then we only return ids that match both conditions.

Parameters
string$searchPhrase
array$submissionIdsList of allowed submission Ids
Returns
array submission ids

Definition at line 638 of file PKPStatsPublicationHandler.inc.php.

References PKPServices\get(), PKPApplication\get(), PKPHandler\getId(), and APIHandler\getRequest().

Referenced by getMany(), getManyAbstract(), and getManyGalley().

◆ authorize()

PKPStatsPublicationHandler::authorize (   $request,
$args,
  $roleAssignments 
)

Authorize this request.

Routers will call this method automatically thereby enforcing authorization. This method will be called before the validate() method and before passing control on to the handler operation.

NB: This method will be called once for every request only.

Parameters
$requestRequest
$argsarray request arguments
$roleAssignmentsarray the operation role assignment, see getRoleAssignment() for more details.
Returns
boolean

Reimplemented from PKPHandler.

Definition at line 70 of file PKPStatsPublicationHandler.inc.php.

References PKPHandler\addPolicy(), and APIHandler\getSlimRequest().

◆ get()

PKPStatsPublicationHandler::get (   $slimRequest,
  $response,
  $args 
)

Get a single publication's usage statistics

Parameters
$slimRequestobject Request Slim request
$responseobject Response
$argsarray
Returns
object Response

Definition at line 388 of file PKPStatsPublicationHandler.inc.php.

References _processAllowedParams(), APIHandler\_validateStatDates(), HookRegistry\call(), PKPServices\get(), PKPHandler\getAuthorizedContextObject(), and APIHandler\getRequest().

◆ getAbstract()

PKPStatsPublicationHandler::getAbstract (   $slimRequest,
  $response,
  $args 
)

Get the total abstract views for a set of publications broken down by month or day

Parameters
$slimRequestRequest Slim request object
$responseobject Response
$argsarray
Returns
object Response

Definition at line 475 of file PKPStatsPublicationHandler.inc.php.

References _processAllowedParams(), APIHandler\_validateStatDates(), HookRegistry\call(), PKPServices\get(), PKPHandler\getAuthorizedContextObject(), and APIHandler\getRequest().

◆ getGalley()

PKPStatsPublicationHandler::getGalley (   $slimRequest,
  $response,
  $args 
)

Get the total galley views for a publication broken down by month or day

Parameters
$slimRequestRequest Slim request object
$responseobject Response
$argsarray
Returns
object Response

Definition at line 526 of file PKPStatsPublicationHandler.inc.php.

References _processAllowedParams(), APIHandler\_validateStatDates(), HookRegistry\call(), PKPServices\get(), PKPHandler\getAuthorizedContextObject(), and APIHandler\getRequest().

◆ getMany()

PKPStatsPublicationHandler::getMany (   $slimRequest,
  $response,
  $args 
)

Get usage stats for a set of publications

Returns total views by abstract, all galleys, pdf galleys, html galleys, and other galleys.

Parameters
$slimRequestRequest Slim request object
$responseobject Response
$argsarray
Returns
object Response

Definition at line 107 of file PKPStatsPublicationHandler.inc.php.

References _processAllowedParams(), _processSearchPhrase(), APIHandler\_validateStatDates(), HookRegistry\call(), PKPServices\get(), PKPApplication\get(), DAORegistry\getDAO(), PKPHandler\getId(), and APIHandler\getRequest().

◆ getManyAbstract()

PKPStatsPublicationHandler::getManyAbstract (   $slimRequest,
  $response,
  $args 
)

Get the total abstract views for a set of publications in a timeline broken down month or day

Parameters
$slimRequestRequest Slim request object
$responseobject Response
$argsarray
Returns
object Response

Definition at line 264 of file PKPStatsPublicationHandler.inc.php.

References _processAllowedParams(), _processSearchPhrase(), APIHandler\_validateStatDates(), HookRegistry\call(), PKPServices\get(), and APIHandler\getRequest().

◆ getManyGalley()

PKPStatsPublicationHandler::getManyGalley (   $slimRequest,
  $response,
  $args 
)

Get the total galley views for a set of publications in a timeline broken down month or day

Parameters
$slimRequestRequest Slim request object
$responseobject Response
$argsarray
Returns
object Response

Definition at line 327 of file PKPStatsPublicationHandler.inc.php.

References _processAllowedParams(), _processSearchPhrase(), APIHandler\_validateStatDates(), HookRegistry\call(), PKPServices\get(), and APIHandler\getRequest().


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