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

Public Member Functions

 __construct ()
 
_checkForRevision (&$uploadedFile, &$submissionFiles)
 
 _getMetadataForm ($request)
 
 _getUploadedFileInfo ($uploadedFile)
 
 _onlyNumbersDiffer ($a, $b)
 
 confirmRevision ($args, $request)
 
 displayFileUploadForm ($args, $request)
 
 editMetadata ($args, $request)
 
 finishFileSubmission ($args, $request)
 
 getAssocId ()
 
 getAssocType ()
 
 getFileStage ()
 
 getReviewRound ()
 
 getRevisedFileId ()
 
 getRevisionOnly ()
 
 getStageId ()
 
 getSubmission ()
 
 getUploaderRoles ()
 
 initialize ($request)
 
 startWizard ($args, $request)
 
 uploadFile ($args, $request)
 
- Public Member Functions inherited from PKPHandler
 addPolicy ($authorizationPolicy, $addToTop=false)
 
 addRoleAssignment ($roleIds, $operations)
 
 authorize ($request, &$args, $roleAssignments)
 
 getApiToken ()
 
getAuthorizedContext ()
 
getAuthorizedContextObject ($assocType)
 
getDispatcher ()
 
 getFirstUserContext ($user, $contexts)
 
 getId ()
 
 getLastAuthorizationMessage ()
 
 getRoleAssignment ($roleId)
 
 getRoleAssignments ()
 
 getSiteRedirectContext ($request)
 
 getTargetContext ($request, &$contextsCount=null)
 
 index ($args, $request)
 
 markRoleAssignmentsChecked ()
 
 requireSSL ()
 
 setApiToken ($apiToken)
 
 setDispatcher ($dispatcher)
 
 setEnforceRestrictedSite ($enforceRestrictedSite)
 
 setId ($id)
 
 setupTemplate ($request)
 
 validate ($requiredContexts=null, $request=null)
 

Data Fields

 $_assocId
 
 $_assocType
 
 $_fileStage
 
 $_reviewRound
 
 $_revisedFileId
 
 $_revisionOnly
 
 $_uploaderRoles
 
- Data Fields inherited from PKPHandler
 $_authorizationDecisionManager
 
 $_checks = array()
 
 $_dispatcher
 
 $_enforceRestrictedSite = true
 
 $_id
 
 $_isBackendPage = false
 
 $_roleAssignments = array()
 
 $_roleAssignmentsChecked = false
 

Protected Member Functions

 _attachEntities ($submissionFile)
 

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

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

Constructor & Destructor Documentation

◆ __construct()

PKPFileUploadWizardHandler::__construct ( )

Constructor

Reimplemented from PKPHandler.

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

References PKPHandler\addRoleAssignment().

Member Function Documentation

◆ _attachEntities()

PKPFileUploadWizardHandler::_attachEntities (   $submissionFile)
protected

Attach any dependent entities to a new file upload.

Parameters
$submissionFileSubmissionFile

Reimplemented in FileUploadWizardHandler.

Definition at line 313 of file PKPFileUploadWizardHandler.inc.php.

References PKPApplication\get(), DAORegistry\getDAO(), getReviewRound(), and getSubmission().

Referenced by confirmRevision(), and uploadFile().

◆ _checkForRevision()

& PKPFileUploadWizardHandler::_checkForRevision ( $uploadedFile,
$submissionFiles 
)

Check if the uploaded file has a similar name to an existing file which would then be a candidate for a revised file.

Parameters
$uploadedFileSubmissionFile
$submissionFilesarray a list of submission files to check the uploaded file against.
Returns
integer the if of the possibly revised file or null if no matches were found.

Definition at line 511 of file PKPFileUploadWizardHandler.inc.php.

References _onlyNumbersDiffer(), and Config\getVar().

Referenced by uploadFile().

◆ _getMetadataForm()

PKPFileUploadWizardHandler::_getMetadataForm (   $request)

Retrieve the requested meta-data form.

Parameters
$requestRequest
Returns
SubmissionFilesMetadataForm

Definition at line 497 of file PKPFileUploadWizardHandler.inc.php.

References PKPHandler\getAuthorizedContextObject(), getReviewRound(), and getStageId().

Referenced by editMetadata().

◆ _getUploadedFileInfo()

PKPFileUploadWizardHandler::_getUploadedFileInfo (   $uploadedFile)

Create an array that describes an uploaded file which can be used in a JSON response.

Parameters
SubmissionFile$uploadedFile
Returns
array

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

Referenced by confirmRevision(), and uploadFile().

◆ _onlyNumbersDiffer()

PKPFileUploadWizardHandler::_onlyNumbersDiffer (   $a,
  $b 
)

Helper function: check if the only difference between $a and $b is numeric. Used to exclude well-named but nearly identical file names from the revision detection pile (e.g. "Chapter 1" and "Chapter 2")

Parameters
$astring
$bstring

Definition at line 553 of file PKPFileUploadWizardHandler.inc.php.

Referenced by _checkForRevision().

◆ confirmRevision()

PKPFileUploadWizardHandler::confirmRevision (   $args,
  $request 
)

Confirm that the uploaded file is a revision of an earlier uploaded file.

Parameters
$argsarray
$requestRequest
Returns
JSONMessage JSON object

Definition at line 425 of file PKPFileUploadWizardHandler.inc.php.

References _attachEntities(), _getUploadedFileInfo(), getReviewRound(), and getSubmission().

◆ displayFileUploadForm()

PKPFileUploadWizardHandler::displayFileUploadForm (   $args,
  $request 
)

Render the file upload form in its initial state.

Parameters
$argsarray
$requestRequest
Returns
JSONMessage JSON object

Definition at line 241 of file PKPFileUploadWizardHandler.inc.php.

References getSubmission().

◆ editMetadata()

PKPFileUploadWizardHandler::editMetadata (   $args,
  $request 
)

Edit the metadata of the latest revision of the requested submission file.

Parameters
$argsarray
$requestRequest
Returns
JSONMessage JSON object

Definition at line 460 of file PKPFileUploadWizardHandler.inc.php.

References _getMetadataForm().

◆ finishFileSubmission()

PKPFileUploadWizardHandler::finishFileSubmission (   $args,
  $request 
)

Display the final tab of the modal

Parameters
$argsarray
$requestRequest
Returns
JSONMessage JSON object

Definition at line 472 of file PKPFileUploadWizardHandler.inc.php.

References PKPTemplateManager\getManager(), and getSubmission().

◆ getAssocId()

PKPFileUploadWizardHandler::getAssocId ( )

Get the assoc id (if any)

Returns
integer

Definition at line 203 of file PKPFileUploadWizardHandler.inc.php.

References $_assocId.

◆ getAssocType()

PKPFileUploadWizardHandler::getAssocType ( )

Get the assoc type (if any)

Returns
integer

Definition at line 195 of file PKPFileUploadWizardHandler.inc.php.

References $_assocType.

◆ getFileStage()

PKPFileUploadWizardHandler::getFileStage ( )

Get the workflow stage file storage that we upload files to. One of the SUBMISSION_FILE_* constants.

Returns
integer

Definition at line 155 of file PKPFileUploadWizardHandler.inc.php.

References $_fileStage.

Referenced by startWizard().

◆ getReviewRound()

PKPFileUploadWizardHandler::getReviewRound ( )

◆ getRevisedFileId()

PKPFileUploadWizardHandler::getRevisedFileId ( )

Get the id of the file to be revised (if any).

Returns
integer

Definition at line 187 of file PKPFileUploadWizardHandler.inc.php.

References $_revisedFileId.

◆ getRevisionOnly()

PKPFileUploadWizardHandler::getRevisionOnly ( )

Does this uploader only allow revisions and no new files?

Returns
boolean

Definition at line 171 of file PKPFileUploadWizardHandler.inc.php.

References $_revisionOnly.

Referenced by initialize().

◆ getStageId()

PKPFileUploadWizardHandler::getStageId ( )

Get the authorized workflow stage.

Returns
integer One of the WORKFLOW_STAGE_ID_* constants.

Definition at line 145 of file PKPFileUploadWizardHandler.inc.php.

References PKPHandler\getAuthorizedContextObject().

Referenced by _getMetadataForm(), and startWizard().

◆ getSubmission()

PKPFileUploadWizardHandler::getSubmission ( )

◆ getUploaderRoles()

PKPFileUploadWizardHandler::getUploaderRoles ( )

Get the uploader roles.

Returns
array

Definition at line 163 of file PKPFileUploadWizardHandler.inc.php.

References $_uploaderRoles.

Referenced by startWizard().

◆ initialize()

PKPFileUploadWizardHandler::initialize (   $request)

Subclasses can override this method to configure the handler.

NB: This method will be called after validation and authorization.

Parameters
$requestPKPRequest

Reimplemented from PKPHandler.

Definition at line 90 of file PKPFileUploadWizardHandler.inc.php.

References fatalError(), getReviewRound(), getRevisionOnly(), and AppLocale\requireComponents().

◆ startWizard()

PKPFileUploadWizardHandler::startWizard (   $args,
  $request 
)

Displays the file upload wizard.

Parameters
$argsarray
$requestRequest
Returns
JSONMessage JSON object

Definition at line 216 of file PKPFileUploadWizardHandler.inc.php.

References getFileStage(), PKPHandler\getId(), PKPTemplateManager\getManager(), getReviewRound(), getStageId(), getSubmission(), and getUploaderRoles().

◆ uploadFile()

PKPFileUploadWizardHandler::uploadFile (   $args,
  $request 
)

Upload a file and render the modified upload wizard.

Parameters
$argsarray
$requestRequest
Returns
JSONMessage JSON object

Definition at line 262 of file PKPFileUploadWizardHandler.inc.php.

References _attachEntities(), _checkForRevision(), _getUploadedFileInfo(), getReviewRound(), and getSubmission().

Field Documentation

◆ $_assocId

integer PKPFileUploadWizardHandler::$_assocId

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

Referenced by getAssocId().

◆ $_assocType

integer PKPFileUploadWizardHandler::$_assocType

Definition at line 58 of file PKPFileUploadWizardHandler.inc.php.

Referenced by getAssocType().

◆ $_fileStage

integer PKPFileUploadWizardHandler::$_fileStage

Definition at line 28 of file PKPFileUploadWizardHandler.inc.php.

Referenced by getFileStage().

◆ $_reviewRound

int PKPFileUploadWizardHandler::$_reviewRound

Definition at line 46 of file PKPFileUploadWizardHandler.inc.php.

◆ $_revisedFileId

integer PKPFileUploadWizardHandler::$_revisedFileId

Definition at line 52 of file PKPFileUploadWizardHandler.inc.php.

Referenced by getRevisedFileId().

◆ $_revisionOnly

boolean PKPFileUploadWizardHandler::$_revisionOnly

Definition at line 40 of file PKPFileUploadWizardHandler.inc.php.

Referenced by getRevisionOnly().

◆ $_uploaderRoles

array PKPFileUploadWizardHandler::$_uploaderRoles

Definition at line 34 of file PKPFileUploadWizardHandler.inc.php.

Referenced by getUploaderRoles().


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