메소드 | 설명 | |
---|---|---|
__construct ( $contextId, $submissionId ) | Constructor. | |
_getFile ( $fileId, $revision = null ) : SubmissionFile | Internal helper method to retrieve file information by file ID. | |
_handleUpload ( $fileName, $fileStage, $uploaderUserId, $uploaderUserGroupId, $revisedFileId = null, $genreId = null, $assocType = null, $assocId = null ) : SubmissionFile | Upload the file and add it to the database. | |
_instantiateSubmissionFile ( $sourceFilePath, $fileStage, $revisedFileId = null, $genreId = null, $assocType = null, $assocId = null ) : SubmissionFile | Routine to instantiate and pre-populate a new submission file. | |
copyFileToFileStage ( $sourceFileId, $sourceRevision, $newFileStage, $destFileId = null, $viewable = false ) | Copies an existing ArticleFile and renames it. | |
deleteFile ( $fileId, $revision = null ) : boolean | Delete a file. | |
downloadFile ( $fileId, $revision = null, $inline = false, $filename = null ) : boolean | Download a file. | |
recordView ( $submissionFile ) | Record a file view in database. | |
temporaryFileToSubmissionFile ( $temporaryFile, $fileStage, $uploaderUserId, $uploaderUserGroupId, $revisedFileId, $genreId, $assocType, $assocId ) : integer | Copy a temporary file to a submission file. | |
uploadSubmissionFile ( $fileName, $fileStage, $uploaderUserId, $uploaderUserGroupId, $revisedFileId = null, $genreId = null, $assocType = null, $assocId = null ) : SubmissionFile | Upload a submission file. |
public __construct ( $contextId, $submissionId ) | ||
$contextId | int | |
$submissionId | int |
public _getFile ( $fileId, $revision = null ) : SubmissionFile | ||
$fileId | integer | |
$revision | integer | |
리턴 | SubmissionFile |
public _handleUpload ( $fileName, $fileStage, $uploaderUserId, $uploaderUserGroupId, $revisedFileId = null, $genreId = null, $assocType = null, $assocId = null ) : SubmissionFile | ||
$fileName | string index into the $_FILES array | |
$fileStage | int submission file stage (one of the SUBMISSION_FILE_* constants) | |
$uploaderUserId | int The id of the user that uploaded the file. | |
$uploaderUserGroupId | int The id of the user group that the uploader acted in when uploading the file. | |
$revisedFileId | int ID of an existing file to revise | |
$genreId | int foreign key into genres table (e.g. manuscript, etc.) | |
$assocType | int | |
$assocId | int | |
리턴 | SubmissionFile | the uploaded submission file or null if an error occured. |
public _instantiateSubmissionFile ( $sourceFilePath, $fileStage, $revisedFileId = null, $genreId = null, $assocType = null, $assocId = null ) : SubmissionFile | ||
$sourceFilePath | string | |
$fileStage | integer SUBMISSION_FILE_... | |
$revisedFileId | integer optional | |
$genreId | integer optional | |
$assocType | integer optional | |
$assocId | integer optional | |
리턴 | SubmissionFile | returns the instantiated submission file or null if an error occurs. |
public copyFileToFileStage ( $sourceFileId, $sourceRevision, $newFileStage, $destFileId = null, $viewable = false ) | ||
$sourceFileId | int | |
$sourceRevision | int | |
$destFileId | int (optional) | |
$viewable | boolean (optional) |
public deleteFile ( $fileId, $revision = null ) : boolean | ||
$fileId | integer | |
리턴 | boolean | returns true if successful |
public downloadFile ( $fileId, $revision = null, $inline = false, $filename = null ) : boolean | ||
$fileId | int the file id of the file to download | |
$revision | int the revision of the file to download | |
$inline | boolean print file as inline instead of attachment, optional | |
$filename | string The client-side download filename (optional) | |
리턴 | boolean |
public recordView ( $submissionFile ) | ||
$submissionFile | SubmissionFile |
public temporaryFileToSubmissionFile ( $temporaryFile, $fileStage, $uploaderUserId, $uploaderUserGroupId, $revisedFileId, $genreId, $assocType, $assocId ) : integer | ||
$temporaryFile | SubmissionFile | |
$fileStage | integer | |
$assocType | integer | |
$assocId | integer | |
리턴 | integer | the file ID (false if upload failed) |
public uploadSubmissionFile ( $fileName, $fileStage, $uploaderUserId, $uploaderUserGroupId, $revisedFileId = null, $genreId = null, $assocType = null, $assocId = null ) : SubmissionFile | ||
$fileName | string the name of the file used in the POST form | |
$fileStage | int submission file workflow stage | |
$uploaderUserId | int The id of the user that uploaded the file. | |
$uploaderUserGroupId | int The id of the user group that the uploader acted in when uploading the file. | |
$revisedFileId | int | |
$genreId | int (e.g. Manuscript, Appendix, etc.) | |
리턴 | SubmissionFile |