Open Preprint Systems  3.3.0
PreprintHandler Class Reference
Inheritance diagram for PreprintHandler:
Handler PKPHandler

Public Member Functions

 authorize ($request, &$args, $roleAssignments)
 
 download ($args, $request)
 
 initialize ($request, $args=array())
 
 setupTemplate ($request)
 
 userCanViewGalley ($request, $preprintId, $galleyId=null)
 
 view ($args, $request)
 
 viewFile ($args, $request)
 
- Public Member Functions inherited from PKPHandler
 __construct ()
 
 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)
 
 validate ($requiredContexts=null, $request=null)
 

Data Fields

 $context
 
 $fileId
 
 $galley
 
 $preprint
 
 $publication
 
- Data Fields inherited from PKPHandler
 $_authorizationDecisionManager
 
 $_checks = array()
 
 $_dispatcher
 
 $_enforceRestrictedSite = true
 
 $_id
 
 $_isBackendPage = false
 
 $_roleAssignments = array()
 
 $_roleAssignmentsChecked = false
 

Additional Inherited Members

- Static Public Member Functions inherited from PKPHandler
static getPageParamName ($rangeName)
 
static getRangeInfo ($request, $rangeName, $contextData=null)
 
static hashPageContext ($request, $contextData=array())
 
- Protected Attributes inherited from PKPHandler
 $_apiToken = null
 

Detailed Description

Handle requests for preprint functions.

Definition at line 21 of file PreprintHandler.inc.php.

Member Function Documentation

◆ authorize()

PreprintHandler::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 PreprintHandler.inc.php.

References PKPHandler\addPolicy(), Config\getVar(), and PKPHandler\setApiToken().

◆ download()

PreprintHandler::download (   $args,
  $request 
)

Download an preprint file

Parameters
array$args
PKPRequest$request

Definition at line 307 of file PreprintHandler.inc.php.

References HookRegistry\call(), DAORegistry\getDAO(), and userCanViewGalley().

◆ initialize()

PreprintHandler::initialize (   $request,
  $args = array() 
)
See also
PKPHandler::initialize()
Parameters
$argsarray Arguments list

Definition at line 64 of file PreprintHandler.inc.php.

References $galley, $publication, and PKPServices\get().

◆ setupTemplate()

PreprintHandler::setupTemplate (   $request)

Set up the template. (Load required locale components.)

Parameters
$requestPKPRequest

Reimplemented from PKPHandler.

Definition at line 364 of file PreprintHandler.inc.php.

References AppLocale\requireComponents().

Referenced by view().

◆ userCanViewGalley()

PreprintHandler::userCanViewGalley (   $request,
  $preprintId,
  $galleyId = null 
)

Determines whether a user can view this preprint galley or not.

Parameters
$requestRequest
$preprintIdstring
$galleyIdint or string

Definition at line 350 of file PreprintHandler.inc.php.

References $preprint.

Referenced by download(), and view().

◆ view()

PreprintHandler::view (   $args,
  $request 
)

View Preprint. (Either preprint landing page or galley view.)

Parameters
$argsarray
$requestRequest

Definition at line 147 of file PreprintHandler.inc.php.

References $context, $galley, $preprint, $publication, HookRegistry\call(), fatalError(), PKPApplication\get(), DAORegistry\getDAO(), PKPTemplateManager\getManager(), PluginRegistry\loadCategory(), setupTemplate(), and userCanViewGalley().

◆ viewFile()

PreprintHandler::viewFile (   $args,
  $request 
)

Download an preprint file For deprecated OJS 2.x URLs; see https://github.com/pkp/pkp-lib/issues/1541

Parameters
$argsarray
$requestPKPRequest

Definition at line 294 of file PreprintHandler.inc.php.

References $fileId.

Field Documentation

◆ $context

PreprintHandler::$context

context associated with the request

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

Referenced by view().

◆ $fileId

PreprintHandler::$fileId

fileId associated with the request

Definition at line 35 of file PreprintHandler.inc.php.

Referenced by viewFile().

◆ $galley

PreprintHandler::$galley

galley associated with the request

Definition at line 32 of file PreprintHandler.inc.php.

Referenced by initialize(), and view().

◆ $preprint

PreprintHandler::$preprint

submission associated with the request

Definition at line 26 of file PreprintHandler.inc.php.

Referenced by userCanViewGalley(), and view().

◆ $publication

PreprintHandler::$publication

publication associated with the request

Definition at line 29 of file PreprintHandler.inc.php.

Referenced by initialize(), and view().


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