PHP 클래스 SubmissionFileManager, pkp-lib

상속: extends BaseSubmissionFileManager
파일 보기 프로젝트 열기: pkp/pkp-lib 1 사용 예제들

공개 메소드들

메소드 설명
__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.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( $contextId, $submissionId )
$contextId int
$submissionId int

_getFile() 공개 메소드

Internal helper method to retrieve file information by file ID.
public _getFile ( $fileId, $revision = null ) : SubmissionFile
$fileId integer
$revision integer
리턴 SubmissionFile

_handleUpload() 공개 메소드

Upload the file and add it to the database.
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.

_instantiateSubmissionFile() 공개 메소드

Routine to instantiate and pre-populate a new submission file.
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.

copyFileToFileStage() 공개 메소드

Copies an existing ArticleFile and renames it.
public copyFileToFileStage ( $sourceFileId, $sourceRevision, $newFileStage, $destFileId = null, $viewable = false )
$sourceFileId int
$sourceRevision int
$destFileId int (optional)
$viewable boolean (optional)

deleteFile() 공개 메소드

Delete a file.
public deleteFile ( $fileId, $revision = null ) : boolean
$fileId integer
리턴 boolean returns true if successful

downloadFile() 공개 메소드

Download a file.
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

recordView() 공개 메소드

Record a file view in database.
public recordView ( $submissionFile )
$submissionFile SubmissionFile

temporaryFileToSubmissionFile() 공개 메소드

Copy a temporary file to a submission file.
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)

uploadSubmissionFile() 공개 메소드

Upload a submission file.
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