PHP Class PKPFileUploadWizardHandler, pkp-lib

Inheritance: extends Handler
ファイルを表示 Open project: pkp/pkp-lib Class Usage Examples

Public Properties

Property Type Description
$_assocId integer
$_assocType integer
$_fileStage integer
$_reviewRound integer
$_revisedFileId integer
$_revisionOnly boolean
$_uploaderGroupIds array
$_uploaderRoles array

Public Methods

Method Description
__construct ( ) Constructor
_checkForRevision ( &$uploadedFile, &$submissionFiles ) : integer Check if the uploaded file has a similar name to an existing file which would then be a candidate for a revised file.
_getMetadataForm ( $request ) : SubmissionFilesMetadataForm Retrieve the requested meta-data form.
_getUploadedFileInfo ( SubmissionFile $uploadedFile ) : array Create an array that describes an uploaded file which can be used in a JSON response.
_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")
authorize ( $request, &$args, $roleAssignments )
confirmRevision ( $args, $request ) : JSONMessage Confirm that the uploaded file is a revision of an earlier uploaded file.
displayFileUploadForm ( $args, $request ) : JSONMessage Render the file upload form in its initial state.
editMetadata ( $args, $request ) : JSONMessage Edit the metadata of the latest revision of the requested submission file.
finishFileSubmission ( $args, $request ) : JSONMessage Display the final tab of the modal
getAssocId ( ) : integer Get the assoc id (if any)
getAssocType ( ) : integer Get the assoc type (if any)
getFileStage ( ) : integer Get the workflow stage file storage that we upload files to. One of the SUBMISSION_FILE_* constants.
getReviewRound ( ) : ReviewRound Get review round object.
getRevisedFileId ( ) : integer Get the id of the file to be revised (if any).
getRevisionOnly ( ) : boolean Does this uploader only allow revisions and no new files?
getStageId ( ) : integer Get the authorized workflow stage.
getSubmission ( ) : Submission The submission to which we upload files.
getUploaderGroupIds ( ) : array Get the uploader group IDs.
getUploaderRoles ( ) : array Get the uploader roles.
initialize ( $request, $args )
startWizard ( $args, $request ) : JSONMessage Displays the file upload wizard.
uploadFile ( $args, $request ) : JSONMessage Upload a file and render the modified upload wizard.

Protected Methods

Method Description
_attachEntities ( $submissionFile ) Attach any dependent entities to a new file upload.

Method Details

__construct() public method

Constructor
public __construct ( )

_attachEntities() protected method

Attach any dependent entities to a new file upload.
protected _attachEntities ( $submissionFile )
$submissionFile SubmissionFile

_checkForRevision() public method

Check if the uploaded file has a similar name to an existing file which would then be a candidate for a revised file.
public _checkForRevision ( &$uploadedFile, &$submissionFiles ) : integer
$uploadedFile SubmissionFile
$submissionFiles array a list of submission files to check the uploaded file against.
return integer the if of the possibly revised file or null if no matches were found.

_getMetadataForm() public method

Retrieve the requested meta-data form.
public _getMetadataForm ( $request ) : SubmissionFilesMetadataForm
$request Request
return SubmissionFilesMetadataForm

_getUploadedFileInfo() public method

Create an array that describes an uploaded file which can be used in a JSON response.
public _getUploadedFileInfo ( SubmissionFile $uploadedFile ) : array
$uploadedFile SubmissionFile
return array

_onlyNumbersDiffer() public method

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")
public _onlyNumbersDiffer ( $a, $b )
$a string
$b string

authorize() public method

public authorize ( $request, &$args, $roleAssignments )

confirmRevision() public method

Confirm that the uploaded file is a revision of an earlier uploaded file.
public confirmRevision ( $args, $request ) : JSONMessage
$args array
$request Request
return JSONMessage JSON object

displayFileUploadForm() public method

Render the file upload form in its initial state.
public displayFileUploadForm ( $args, $request ) : JSONMessage
$args array
$request Request
return JSONMessage JSON object

editMetadata() public method

Edit the metadata of the latest revision of the requested submission file.
public editMetadata ( $args, $request ) : JSONMessage
$args array
$request Request
return JSONMessage JSON object

finishFileSubmission() public method

Display the final tab of the modal
public finishFileSubmission ( $args, $request ) : JSONMessage
$args array
$request Request
return JSONMessage JSON object

getAssocId() public method

Get the assoc id (if any)
public getAssocId ( ) : integer
return integer

getAssocType() public method

Get the assoc type (if any)
public getAssocType ( ) : integer
return integer

getFileStage() public method

Get the workflow stage file storage that we upload files to. One of the SUBMISSION_FILE_* constants.
public getFileStage ( ) : integer
return integer

getReviewRound() public method

Get review round object.
public getReviewRound ( ) : ReviewRound
return ReviewRound

getRevisedFileId() public method

Get the id of the file to be revised (if any).
public getRevisedFileId ( ) : integer
return integer

getRevisionOnly() public method

Does this uploader only allow revisions and no new files?
public getRevisionOnly ( ) : boolean
return boolean

getStageId() public method

Get the authorized workflow stage.
public getStageId ( ) : integer
return integer One of the WORKFLOW_STAGE_ID_* constants.

getSubmission() public method

The submission to which we upload files.
public getSubmission ( ) : Submission
return Submission

getUploaderGroupIds() public method

Get the uploader group IDs.
public getUploaderGroupIds ( ) : array
return array

getUploaderRoles() public method

Get the uploader roles.
public getUploaderRoles ( ) : array
return array

initialize() public method

public initialize ( $request, $args )

startWizard() public method

Displays the file upload wizard.
public startWizard ( $args, $request ) : JSONMessage
$args array
$request Request
return JSONMessage JSON object

uploadFile() public method

Upload a file and render the modified upload wizard.
public uploadFile ( $args, $request ) : JSONMessage
$args array
$request Request
return JSONMessage JSON object

Property Details

$_assocId public_oe property

public int $_assocId
return integer

$_assocType public_oe property

public int $_assocType
return integer

$_fileStage public_oe property

public int $_fileStage
return integer

$_reviewRound public_oe property

public int $_reviewRound
return integer

$_revisedFileId public_oe property

public int $_revisedFileId
return integer

$_revisionOnly public_oe property

public bool $_revisionOnly
return boolean

$_uploaderGroupIds public_oe property

public array $_uploaderGroupIds
return array

$_uploaderRoles public_oe property

public array $_uploaderRoles
return array