Helper class for database-backed monograph file management tasks. More...
Public Member Functions | |
| & | _getFile ($fileId, $revision=null) |
| & | _handleUpload ($fileName, $fileStage, $uploaderUserId, $uploaderUserGroupId, $revisedFileId=null, $genreId=null, $assocType=null, $assocId=null) |
| & | _instantiateMonographFile ($sourceFilePath, $fileStage, $revisedFileId=null, $genreId=null, $assocType=null, $assocId=null) |
| copyFileToFileStage ($sourceFileId, $sourceRevision, $newFileStage, $destFileId=null, $viewable=false) | |
| deleteFile ($fileId, $revision=null) | |
| downloadFile ($fileId, $revision=null, $inline=false) | |
| MonographFileManager ($pressId, $monographId) | |
| recordView (&$monographFile) | |
| temporaryFileToMonographFile (&$temporaryFile, $fileStage, $uploaderUserId, $uploaderUserGroupId, $revisedFileId, $genreId, $assocType, $assocId) | |
| & | uploadMonographFile ($fileName, $fileStage, $uploaderUserId, $uploaderUserGroupId, $revisedFileId=null, $genreId=null, $assocType=null, $assocId=null) |
Helper class for database-backed monograph file management tasks.
Monograph directory structure: [monograph id]/note [monograph id]/public [monograph id]/submission [monograph id]/submission/original [monograph id]/submission/review [monograph id]/submission/review/attachment [monograph id]/submission/editor [monograph id]/submission/copyedit [monograph id]/submission/layout [monograph id]/attachment
Definition at line 29 of file MonographFileManager.inc.php.
| & MonographFileManager._getFile | ( | $ | fileId, | |
| $ | revision = null | |||
| ) |
Internal helper method to retrieve file information by file ID.
| $fileId | integer | |
| $revision | integer |
Definition at line 357 of file MonographFileManager.inc.php.
Referenced by deleteFile(), and downloadFile().
| & MonographFileManager._handleUpload | ( | $ | fileName, | |
| $ | fileStage, | |||
| $ | uploaderUserId, | |||
| $ | uploaderUserGroupId, | |||
| $ | 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 monograph file stage (one of the MONOGRAPH_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 |
Definition at line 218 of file MonographFileManager.inc.php.
References _instantiateMonographFile().
Referenced by uploadMonographFile().
| & MonographFileManager._instantiateMonographFile | ( | $ | sourceFilePath, | |
| $ | fileStage, | |||
| $ | revisedFileId = null, |
|||
| $ | genreId = null, |
|||
| $ | assocType = null, |
|||
| $ | assocId = null | |||
| ) |
Routine to instantiate and pre-populate a new monograph file.
| $sourceFilePath | string | |
| $fileStage | integer MONOGRAPH_FILE_... | |
| $revisedFileId | integer optional | |
| $genreId | integer optional | |
| $assocId | integer optional | |
| $assocType | integer optional |
Definition at line 263 of file MonographFileManager.inc.php.
References BaseMonographFileManager.getMonographId().
Referenced by _handleUpload(), and temporaryFileToMonographFile().
| MonographFileManager.copyFileToFileStage | ( | $ | sourceFileId, | |
| $ | sourceRevision, | |||
| $ | newFileStage, | |||
| $ | destFileId = null, |
|||
| $ | viewable = false | |||
| ) |
Copies an existing ArticleFile and renames it.
| $sourceFileId | int | |
| $sourceRevision | int | |
| $fileStage | int | |
| $destFileId | int (optional) | |
| $viewable | boolean (optional) |
Definition at line 158 of file MonographFileManager.inc.php.
| MonographFileManager.deleteFile | ( | $ | fileId, | |
| $ | revision = null | |||
| ) |
Delete a file.
| $fileId | integer | |
| $revisionId | integer |
Definition at line 68 of file MonographFileManager.inc.php.
References _getFile().
| MonographFileManager.downloadFile | ( | $ | fileId, | |
| $ | revision = null, |
|||
| $ | inline = false | |||
| ) |
Download a file.
| $fileId | int the file id of the file to download | |
| $revision | int the revision of the file to download | |
| $inline | print file as inline instead of attachment, optional |
Definition at line 84 of file MonographFileManager.inc.php.
References _getFile(), BaseMonographFileManager.getMonographId(), and recordView().
| MonographFileManager.MonographFileManager | ( | $ | pressId, | |
| $ | monographId | |||
| ) |
Constructor.
| $pressId | int | |
| $monographId | int |
Definition at line 35 of file MonographFileManager.inc.php.
References BaseMonographFileManager.BaseMonographFileManager().
| MonographFileManager.recordView | ( | &$ | monographFile | ) |
Record a file view in database.
| $monographFile | MonographFile |
Definition at line 106 of file MonographFileManager.inc.php.
Referenced by downloadFile(), and FileApiHandler.recordDownload().
| MonographFileManager.temporaryFileToMonographFile | ( | &$ | temporaryFile, | |
| $ | fileStage, | |||
| $ | uploaderUserId, | |||
| $ | uploaderUserGroupId, | |||
| $ | revisedFileId, | |||
| $ | genreId, | |||
| $ | assocType, | |||
| $ | assocId | |||
| ) |
Copy a temporary file to a monograph file.
| $temporaryFile | MonographFile | |
| $fileStage | integer | |
| $assocId | integer | |
| $assocType | integer |
Definition at line 128 of file MonographFileManager.inc.php.
References _instantiateMonographFile().
| & MonographFileManager.uploadMonographFile | ( | $ | fileName, | |
| $ | fileStage, | |||
| $ | uploaderUserId, | |||
| $ | uploaderUserGroupId, | |||
| $ | revisedFileId = null, |
|||
| $ | genreId = null, |
|||
| $ | assocType = null, |
|||
| $ | assocId = null | |||
| ) |
Upload a monograph file.
| $fileName | string the name of the file used in the POST form | |
| $fileStage | int monograph 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.) |
Definition at line 54 of file MonographFileManager.inc.php.
References _handleUpload().
1.7.1