|
Open Monograph Press
3.3.0
|
Public Member Functions | |
| __construct ($contextId, $submissionId) | |
| _getFile ($fileId, $revision=null) | |
| _handleCopy ($filePath, $fileStage, $copyUserId, $revisedFileId=null, $genreId=null, $assocType=null, $assocId=null) | |
| _handleUpload ($fileName, $fileStage, $uploaderUserId, $revisedFileId=null, $genreId=null, $assocType=null, $assocId=null) | |
| _instantiateSubmissionFile ($sourceFilePath, $fileStage, $revisedFileId=null, $genreId=null, $assocType=null, $assocId=null) | |
| copyFileToFileStage ($sourceFileId, $sourceRevision, $newFileStage, $destFileId=null, $viewable=false) | |
| copySubmissionFile ($filePath, $fileStage, $copyUserId, $revisedFileId=null, $genreId=null, $assocType=null, $assocId=null) | |
| deleteById ($fileId, $revision=null) | |
| downloadById ($fileId, $revision=null, $inline=false, $filename=null) | |
| recordView ($submissionFile) | |
| uploadSubmissionFile ($fileName, $fileStage, $uploaderUserId, $revisedFileId=null, $genreId=null, $assocType=null, $assocId=null) | |
Public Member Functions inherited from BaseSubmissionFileManager | |
| getBasePath () | |
| getSubmissionId () | |
Public Member Functions inherited from ContextFileManager | |
| __construct ($contextId) | |
Public Member Functions inherited from PrivateFileManager | |
| __construct () | |
Public Member Functions inherited from FileManager | |
| compressFile ($filePath) | |
| copyDir ($source, $dest) | |
| copyFile ($source, $dest) | |
| decompressFile ($filePath) | |
| deleteByPath ($filePath) | |
| downloadByPath ($filePath, $mediaType=null, $inline=false, $fileName=null) | |
| fileExists ($filePath, $type='file') | |
| getDocumentExtension ($type) | |
| getDocumentType ($type) | |
| getExtension ($fileName) | |
| getFirstUploadedPostName () | |
| getImageExtension ($type) | |
| getNiceFileSize ($size) | |
| getUploadedFileName ($fileName) | |
| getUploadedFilePath ($fileName) | |
| getUploadedFileType ($fileName) | |
| getUploadErrorCode ($fileName) | |
| mkdir ($dirPath, $perms=null) | |
| mkdirtree ($dirPath, $perms=null) | |
| parseFileExtension ($fileName) | |
| readFileFromPath ($filePath, $output=false) | |
| rmdir ($dirPath) | |
| rmtree ($file) | |
| setMode ($path, $mask) | |
| truncateFileName ($fileName, $length=127) | |
| uploadedFileExists ($fileName) | |
| uploadError ($fileName) | |
| uploadFile ($fileName, $destFileName) | |
| writeFile ($dest, &$contents) | |
Additional Inherited Members | |
Data Fields inherited from BaseSubmissionFileManager | |
| $_submissionId | |
Data Fields inherited from ContextFileManager | |
| $contextId | |
Data Fields inherited from PrivateFileManager | |
| $filesDir | |
Helper class for database-backed submission file management tasks.
Submission directory structure: [submission id]/note [submission id]/public [submission id]/submission [submission id]/submission/original [submission id]/submission/review [submission id]/submission/review/attachment [submission id]/submission/editor [submission id]/submission/copyedit [submission id]/submission/layout [submission id]/attachment
Definition at line 30 of file SubmissionFileManager.inc.php.
| SubmissionFileManager::__construct | ( | $contextId, | |
| $submissionId | |||
| ) |
Constructor.
| $contextId | int |
| $submissionId | int |
Reimplemented from BaseSubmissionFileManager.
Definition at line 36 of file SubmissionFileManager.inc.php.
References ContextFileManager\$contextId.
| SubmissionFileManager::_getFile | ( | $fileId, | |
$revision = null |
|||
| ) |
Internal helper method to retrieve file information by file ID.
| $fileId | integer |
| $revision | integer |
Definition at line 388 of file SubmissionFileManager.inc.php.
References DAORegistry\getDAO().
Referenced by deleteById(), and downloadById().
| SubmissionFileManager::_handleCopy | ( | $filePath, | |
| $fileStage, | |||
| $copyUserId, | |||
$revisedFileId = null, |
|||
$genreId = null, |
|||
$assocType = null, |
|||
$assocId = null |
|||
| ) |
Copy a file and add it to the database.
| $filePath | string full path to file on the file system |
| $fileStage | int submission file stage (one of the SUBMISSION_FILE_* constants) |
| $copyUserId | int The id of the user that is copying 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 |
Definition at line 245 of file SubmissionFileManager.inc.php.
References _instantiateSubmissionFile(), FileManager\fileExists(), DAORegistry\getDAO(), PKPString\mime_content_type(), and FileManager\truncateFileName().
Referenced by copySubmissionFile().
| SubmissionFileManager::_handleUpload | ( | $fileName, | |
| $fileStage, | |||
| $uploaderUserId, | |||
$revisedFileId = null, |
|||
$genreId = null, |
|||
$assocType = null, |
|||
$assocId = null |
|||
| ) |
Upload the file and add it to the database.
| $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. |
| $revisedFileId | int ID of an existing file to revise |
| $genreId | int foreign key into genres table (e.g. manuscript, etc.) |
| $assocType | int |
| $assocId | int |
Definition at line 202 of file SubmissionFileManager.inc.php.
References _instantiateSubmissionFile(), DAORegistry\getDAO(), FileManager\getUploadedFileName(), FileManager\getUploadedFilePath(), FileManager\getUploadedFileType(), FileManager\truncateFileName(), and FileManager\uploadedFileExists().
Referenced by uploadSubmissionFile().
| SubmissionFileManager::_instantiateSubmissionFile | ( | $sourceFilePath, | |
| $fileStage, | |||
$revisedFileId = null, |
|||
$genreId = null, |
|||
$assocType = null, |
|||
$assocId = null |
|||
| ) |
Routine to instantiate and pre-populate a new submission file.
| $sourceFilePath | string |
| $fileStage | integer SUBMISSION_FILE_... |
| $revisedFileId | integer optional |
| $genreId | integer optional |
| $assocId | integer optional |
| $assocType | integer optional |
Definition at line 283 of file SubmissionFileManager.inc.php.
References fatalError(), Core\getCurrentDate(), DAORegistry\getDAO(), and BaseSubmissionFileManager\getSubmissionId().
Referenced by _handleCopy(), and _handleUpload().
| SubmissionFileManager::copyFileToFileStage | ( | $sourceFileId, | |
| $sourceRevision, | |||
| $newFileStage, | |||
$destFileId = null, |
|||
$viewable = false |
|||
| ) |
Copies an existing SubmissionFile and renames it.
| $sourceFileId | int |
| $sourceRevision | int |
| $fileStage | int |
| $destFileId | int (optional) |
| $viewable | boolean (optional) |
Definition at line 147 of file SubmissionFileManager.inc.php.
References HookRegistry\call(), Core\getCurrentDate(), and DAORegistry\getDAO().
| SubmissionFileManager::copySubmissionFile | ( | $filePath, | |
| $fileStage, | |||
| $copyUserId, | |||
$revisedFileId = null, |
|||
$genreId = null, |
|||
$assocType = null, |
|||
$assocId = null |
|||
| ) |
Copy a submission file.
| $filePath | string the path of the file on the file system |
| $fileStage | int submission file workflow stage |
| $copyUserId | int The id of the user that originates the file copy |
| $revisedFileId | int |
| $genreId | int (e.g. Manuscript, Appendix, etc.) |
Definition at line 70 of file SubmissionFileManager.inc.php.
References _handleCopy().
| SubmissionFileManager::deleteById | ( | $fileId, | |
$revision = null |
|||
| ) |
Delete a file.
| $fileId | integer |
| $revisionId | integer |
Definition at line 84 of file SubmissionFileManager.inc.php.
References _getFile().
| SubmissionFileManager::downloadById | ( | $fileId, | |
$revision = null, |
|||
$inline = false, |
|||
$filename = null |
|||
| ) |
Download a file.
| $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) |
Definition at line 101 of file SubmissionFileManager.inc.php.
References _getFile(), fatalError(), and recordView().
| SubmissionFileManager::recordView | ( | $submissionFile | ) |
Record a file view in database.
| $submissionFile | SubmissionFile |
Definition at line 124 of file SubmissionFileManager.inc.php.
References DAORegistry\getDAO(), and SessionManager\getManager().
Referenced by downloadById().
| SubmissionFileManager::uploadSubmissionFile | ( | $fileName, | |
| $fileStage, | |||
| $uploaderUserId, | |||
$revisedFileId = null, |
|||
$genreId = null, |
|||
$assocType = null, |
|||
$assocId = null |
|||
| ) |
Upload a submission file.
| $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. |
| $revisedFileId | int |
| $genreId | int (e.g. Manuscript, Appendix, etc.) |
Definition at line 53 of file SubmissionFileManager.inc.php.
References _handleUpload().