Open Journal Systems  3.3.0
FileApiHandler Class Reference
Inheritance diagram for FileApiHandler:
Handler PKPHandler

Public Member Functions

 __construct ()
 
 _getAccessPolicy ($request, $args, $roleAssignments, $fileIdAndRevision=null)
 
 _getFileManager ($contextId, $submissionId)
 
 authorize ($request, &$args, $roleAssignments)
 
 downloadAllFiles ($args, $request)
 
 downloadFile ($args, $request)
 
 downloadLibraryFile ($args, $request)
 
 enableLinkAction ($args, $request)
 
 recordDownload ($args, $request)
 
- 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)
 

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 PKPHandler
 $_apiToken = null
 

Detailed Description

Class defining an AJAX API for supplying file information.

Definition at line 25 of file FileApiHandler.inc.php.

Constructor & Destructor Documentation

◆ __construct()

FileApiHandler::__construct ( )

Constructor.

Reimplemented from PKPHandler.

Definition at line 30 of file FileApiHandler.inc.php.

References PKPHandler\addRoleAssignment().

Member Function Documentation

◆ _getAccessPolicy()

FileApiHandler::_getAccessPolicy (   $request,
  $args,
  $roleAssignments,
  $fileIdAndRevision = null 
)

return the application specific file access policy.

Parameters
$requestPKPRequest
$args
$roleAssignmentsarray
$fileIdAndRevisionarray optional
Returns
SubmissionFileAccessPolicy

Definition at line 191 of file FileApiHandler.inc.php.

Referenced by authorize().

◆ _getFileManager()

FileApiHandler::_getFileManager (   $contextId,
  $submissionId 
)

return the application specific file manager.

Parameters
$contextIdint the context for this manager.
$submissionIdint the submission id.
Returns
SubmissionFileManager

Definition at line 179 of file FileApiHandler.inc.php.

Referenced by downloadAllFiles(), and downloadFile().

◆ authorize()

FileApiHandler::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 41 of file FileApiHandler.inc.php.

References _getAccessPolicy(), and PKPHandler\addPolicy().

◆ downloadAllFiles()

FileApiHandler::downloadAllFiles (   $args,
  $request 
)

Download all passed files.

Parameters
$argsarray
$requestRequest

Definition at line 105 of file FileApiHandler.inc.php.

References _getFileManager(), fatalError(), and PKPHandler\getAuthorizedContextObject().

◆ downloadFile()

FileApiHandler::downloadFile (   $args,
  $request 
)

Download a file.

Parameters
$argsarray
$requestRequest

Definition at line 77 of file FileApiHandler.inc.php.

References _getFileManager(), fatalError(), and PKPHandler\getAuthorizedContextObject().

◆ downloadLibraryFile()

FileApiHandler::downloadLibraryFile (   $args,
  $request 
)

Download a library file.

Parameters
$argsarray
$requestRequest

Definition at line 94 of file FileApiHandler.inc.php.

◆ enableLinkAction()

FileApiHandler::enableLinkAction (   $args,
  $request 
)

Returns a data changd event to re-enable the link action. Refactored out of recordDownload since library files do not have downloads recorded and are in a different context.

Parameters
$argsaray
$requestRequest
Returns
JSONMessage JSON object

Definition at line 169 of file FileApiHandler.inc.php.

References DAO\getDataChangedEvent().

Referenced by recordDownload().

◆ recordDownload()

FileApiHandler::recordDownload (   $args,
  $request 
)

Record file download and return js event to update grid rows.

Parameters
$argsarray
$requestRequest
Returns
string

Definition at line 143 of file FileApiHandler.inc.php.

References enableLinkAction(), and PKPHandler\getAuthorizedContextObject().


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