
Public Member Functions | |
| ArticleFileManager ($articleId) | |
| copyAndRenameFile ($sourceFileId, $sourceRevision, $destType, $destFileId=null) | |
| copyAttachmentFile ($url, $mimeType, $fileId=null, $overwrite=true, $assocId=null) | |
| copyPublicFile ($url, $mimeType, $fileId=null, $overwrite=true) | |
| copySuppFile ($url, $mimeType, $fileId=null, $overwrite=true) | |
| copyToCopyeditFile ($fileId, $revision=null) | |
| copyToEditorFile ($fileId, $revision=null, $destFileId=null) | |
| copyToLayoutFile ($fileId, $revision=null) | |
| copyToReviewFile ($fileId, $revision=null, $destFileId=null) | |
| deleteArticleTree () | |
| deleteFile ($fileId, $revision=null) | |
| downloadFile ($fileId, $revision=null, $inline=false) | |
| & | generateDummyFile (&$article) |
| generateFilename (&$articleFile, $type, $originalName) | |
| & | getFile ($fileId, $revision=null) |
| handleCopy ($url, $mimeType, $type, $fileId=null, $overwrite=false) | |
| handleUpload ($fileName, $type, $fileId=null, $overwrite=false) | |
| handleWrite ($fileName, &$contents, $mimeType, $type, $fileId=null, $overwrite=false) | |
| readFile ($fileId, $revision=null, $output=false) | |
| removePriorRevisions ($fileId, $revision) | |
| temporaryFileToArticleFile (&$temporaryFile, $type, $assocId=null) | |
| typeToPath ($type) | |
| uploadCopyeditFile ($fileName, $fileId=null) | |
| uploadEditorDecisionFile ($fileName, $fileId=null) | |
| uploadLayoutFile ($fileName, $fileId=null, $overwrite=true) | |
| uploadPublicFile ($fileName, $fileId=null, $overwrite=true) | |
| uploadReviewFile ($fileName, $fileId=null) | |
| uploadSubmissionFile ($fileName, $fileId=null, $overwrite=false) | |
| uploadSubmissionNoteFile ($fileName, $fileId=null, $overwrite=true) | |
| uploadSuppFile ($fileName, $fileId=null, $overwrite=true) | |
| viewFile ($fileId, $revision=null) | |
| writePublicFile ($fileName, &$contents, $mimeType, $fileId=null, $overwrite=true) | |
| writeSuppFile ($fileName, &$contents, $mimeType, $fileId=null, $overwrite=true) | |
Article directory structure: [article id]/note [article id]/public [article id]/submission [article id]/submission/original [article id]/submission/review [article id]/submission/editor [article id]/submission/copyedit [article id]/submission/layout [article id]/supp [article id]/attachment
Definition at line 43 of file ArticleFileManager.inc.php.
| ArticleFileManager.ArticleFileManager | ( | $ | articleId | ) |
Constructor. Create a manager for handling article file uploads.
| $articleId | int |
Definition at line 59 of file ArticleFileManager.inc.php.
References DAORegistry.getDAO(), and Config.getVar().
| ArticleFileManager.copyAndRenameFile | ( | $ | sourceFileId, | |
| $ | sourceRevision, | |||
| $ | destType, | |||
| $ | destFileId = null | |||
| ) |
Copies an existing ArticleFile and renames it.
| $sourceFileId | int | |
| $sourceRevision | int | |
| $destType | string | |
| $destFileId | int (optional) |
Definition at line 371 of file ArticleFileManager.inc.php.
References FileManager.fileExists(), Core.getCurrentDate(), DAORegistry.getDAO(), FileManager.mkdirtree(), FileManager.parseFileExtension(), and typeToPath().
Referenced by copyToCopyeditFile(), copyToEditorFile(), copyToLayoutFile(), and copyToReviewFile().
| ArticleFileManager.copyAttachmentFile | ( | $ | url, | |
| $ | mimeType, | |||
| $ | fileId = null, |
|||
| $ | overwrite = true, |
|||
| $ | assocId = null | |||
| ) |
Copy an attachment file.
| $url | string The source URL/filename | |
| $mimeType | string The mime type of the original file | |
| $fileId | int | |
| $overwrite | boolean |
Definition at line 205 of file ArticleFileManager.inc.php.
References handleCopy().
| ArticleFileManager.copyPublicFile | ( | $ | url, | |
| $ | mimeType, | |||
| $ | fileId = null, |
|||
| $ | overwrite = true | |||
| ) |
Copy a public file.
| $url | string The source URL/filename | |
| $mimeType | string The mime type of the original file | |
| $fileId | int | |
| $overwrite | boolean |
Definition at line 171 of file ArticleFileManager.inc.php.
References handleCopy().
| ArticleFileManager.copySuppFile | ( | $ | url, | |
| $ | mimeType, | |||
| $ | fileId = null, |
|||
| $ | overwrite = true | |||
| ) |
Copy a supplemental file.
| $url | string The source URL/filename | |
| $mimeType | string The mime type of the original file | |
| $fileId | int | |
| $overwrite | boolean |
Definition at line 194 of file ArticleFileManager.inc.php.
References handleCopy().
| ArticleFileManager.copyToCopyeditFile | ( | $ | fileId, | |
| $ | revision = null | |||
| ) |
Copies an existing file to create a copyedit file.
| $fileId | int the file id of the editor file. | |
| $revision | int the revision of the editor file. |
Definition at line 331 of file ArticleFileManager.inc.php.
References copyAndRenameFile().
| ArticleFileManager.copyToEditorFile | ( | $ | fileId, | |
| $ | revision = null, |
|||
| $ | destFileId = null | |||
| ) |
Copies an existing file to create an editor decision file.
| $fileId | int the file id of the review file. | |
| $revision | int the revision of the review file. | |
| $destFileId | int file ID to copy to |
Definition at line 321 of file ArticleFileManager.inc.php.
References copyAndRenameFile().
| ArticleFileManager.copyToLayoutFile | ( | $ | fileId, | |
| $ | revision = null | |||
| ) |
Copies an existing file to create a layout file.
| $fileId | int the file id of the copyedit file. | |
| $revision | int the revision of the copyedit file. |
Definition at line 341 of file ArticleFileManager.inc.php.
References copyAndRenameFile().
| ArticleFileManager.copyToReviewFile | ( | $ | fileId, | |
| $ | revision = null, |
|||
| $ | destFileId = null | |||
| ) |
Copies an existing file to create a review file.
| $originalFileId | int the file id of the original file. | |
| $originalRevision | int the revision of the original file. | |
| $destFileId | int the file id of the current review file |
Definition at line 310 of file ArticleFileManager.inc.php.
References copyAndRenameFile().
| ArticleFileManager.deleteArticleTree | ( | ) |
Delete the entire tree of files belonging to an article.
Definition at line 271 of file ArticleFileManager.inc.php.
| ArticleFileManager.deleteFile | ( | $ | fileId, | |
| $ | revision = null | |||
| ) |
Delete a file by ID. If no revision is specified, all revisions of the file are deleted.
| $fileId | int | |
| $revision | int (optional) |
Definition at line 245 of file ArticleFileManager.inc.php.
References DAORegistry.getDAO().
Referenced by removePriorRevisions().
| ArticleFileManager.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 |
Reimplemented from FileManager.
Definition at line 282 of file ArticleFileManager.inc.php.
References getFile().
Referenced by viewFile().
| & ArticleFileManager.generateDummyFile | ( | &$ | article | ) |
PRIVATE routine to generate a dummy file. Used in handleUpload.
| $article | object |
Definition at line 434 of file ArticleFileManager.inc.php.
References Core.getCurrentDate(), and DAORegistry.getDAO().
Referenced by handleCopy(), handleUpload(), handleWrite(), and temporaryFileToArticleFile().
| ArticleFileManager.generateFilename | ( | &$ | articleFile, | |
| $ | type, | |||
| $ | originalName | |||
| ) |
PRIVATE routine to generate a filename for an article file. Sets the filename field in the articleFile to the generated value.
| $articleFile | The article to generate a filename for | |
| $type | The type of the article (e.g. as supplied to handleUpload) | |
| $originalName | The name of the original file |
Definition at line 474 of file ArticleFileManager.inc.php.
References FileManager.parseFileExtension().
Referenced by handleCopy(), handleUpload(), handleWrite(), and temporaryFileToArticleFile().
| & ArticleFileManager.getFile | ( | $ | fileId, | |
| $ | revision = null | |||
| ) |
Retrieve file information by file ID.
Definition at line 213 of file ArticleFileManager.inc.php.
References DAORegistry.getDAO().
Referenced by downloadFile(), and readFile().
| ArticleFileManager.handleCopy | ( | $ | url, | |
| $ | mimeType, | |||
| $ | type, | |||
| $ | fileId = null, |
|||
| $ | overwrite = false | |||
| ) |
PRIVATE routine to copy an article file and add it to the database.
| $url | original filename/url of the file | |
| $mimeType | string the mime type of the file | |
| $type | string identifying type | |
| $fileId | int ID of an existing file to update | |
| $overwrite | boolean overwrite all previous revisions of the file (revision number is still incremented) |
Definition at line 596 of file ArticleFileManager.inc.php.
References FileManager.copyFile(), generateDummyFile(), generateFilename(), Core.getCurrentDate(), DAORegistry.getDAO(), removePriorRevisions(), FileManager.truncateFileName(), and typeToPath().
Referenced by copyAttachmentFile(), copyPublicFile(), and copySuppFile().
| ArticleFileManager.handleUpload | ( | $ | fileName, | |
| $ | type, | |||
| $ | fileId = null, |
|||
| $ | overwrite = false | |||
| ) |
PRIVATE routine to upload the file and add it to the database.
| $fileName | string index into the $_FILES array | |
| $type | string identifying type | |
| $fileId | int ID of an existing file to update | |
| $overwrite | boolean overwrite all previous revisions of the file (revision number is still incremented) |
Definition at line 489 of file ArticleFileManager.inc.php.
References generateDummyFile(), generateFilename(), Core.getCurrentDate(), DAORegistry.getDAO(), FileManager.getUploadedFileName(), removePriorRevisions(), FileManager.truncateFileName(), typeToPath(), and FileManager.uploadFile().
Referenced by uploadCopyeditFile(), uploadEditorDecisionFile(), uploadLayoutFile(), uploadPublicFile(), uploadReviewFile(), uploadSubmissionFile(), uploadSubmissionNoteFile(), and uploadSuppFile().
| ArticleFileManager.handleWrite | ( | $ | fileName, | |
| &$ | contents, | |||
| $ | mimeType, | |||
| $ | type, | |||
| $ | fileId = null, |
|||
| $ | overwrite = false | |||
| ) |
PRIVATE routine to write an article file and add it to the database.
| $fileName | original filename of the file | |
| $contents | string contents of the file to write | |
| $mimeType | string the mime type of the file | |
| $type | string identifying type | |
| $fileId | int ID of an existing file to update | |
| $overwrite | boolean overwrite all previous revisions of the file (revision number is still incremented) |
Definition at line 543 of file ArticleFileManager.inc.php.
References generateDummyFile(), generateFilename(), Core.getCurrentDate(), DAORegistry.getDAO(), removePriorRevisions(), FileManager.truncateFileName(), typeToPath(), and FileManager.writeFile().
Referenced by writePublicFile(), and writeSuppFile().
| ArticleFileManager.readFile | ( | $ | fileId, | |
| $ | revision = null, |
|||
| $ | output = false | |||
| ) |
Read a file's contents.
| $output | boolean output the file's contents instead of returning a string |
Definition at line 224 of file ArticleFileManager.inc.php.
References getFile().
| ArticleFileManager.removePriorRevisions | ( | $ | fileId, | |
| $ | revision | |||
| ) |
PRIVATE routine to remove all prior revisions of a file.
Definition at line 457 of file ArticleFileManager.inc.php.
References deleteFile(), and DAORegistry.getDAO().
Referenced by handleCopy(), handleUpload(), handleWrite(), and temporaryFileToArticleFile().
| ArticleFileManager.temporaryFileToArticleFile | ( | &$ | temporaryFile, | |
| $ | type, | |||
| $ | assocId = null | |||
| ) |
Copy a temporary file to an article file.
| TemporaryFile |
Definition at line 646 of file ArticleFileManager.inc.php.
References FileManager.copyFile(), generateDummyFile(), generateFilename(), DAORegistry.getDAO(), removePriorRevisions(), and typeToPath().
| ArticleFileManager.typeToPath | ( | $ | type | ) |
Return type path associated with a type code.
| $type | string |
Definition at line 350 of file ArticleFileManager.inc.php.
Referenced by copyAndRenameFile(), ArticleFileDAO.getArticleFilesByAssocId(), handleCopy(), handleUpload(), handleWrite(), and temporaryFileToArticleFile().
| ArticleFileManager.uploadCopyeditFile | ( | $ | fileName, | |
| $ | fileId = null | |||
| ) |
Upload a file to the copyedit file folder.
| $fileName | string the name of the file used in the POST form | |
| $fileId | int |
Definition at line 104 of file ArticleFileManager.inc.php.
References handleUpload().
| ArticleFileManager.uploadEditorDecisionFile | ( | $ | fileName, | |
| $ | fileId = null | |||
| ) |
Upload a file to the editor decision file folder.
| $fileName | string the name of the file used in the POST form | |
| $fileId | int |
Definition at line 94 of file ArticleFileManager.inc.php.
References handleUpload().
| ArticleFileManager.uploadLayoutFile | ( | $ | fileName, | |
| $ | fileId = null, |
|||
| $ | overwrite = true | |||
| ) |
Upload a section editor's layout editing file.
| $fileName | string the name of the file used in the POST form | |
| $fileId | int | |
| $overwrite | boolean |
Definition at line 115 of file ArticleFileManager.inc.php.
References handleUpload().
| ArticleFileManager.uploadPublicFile | ( | $ | fileName, | |
| $ | fileId = null, |
|||
| $ | overwrite = true | |||
| ) |
Upload a public file.
| $fileName | string the name of the file used in the POST form | |
| $fileId | int | |
| $overwrite | boolean |
Definition at line 137 of file ArticleFileManager.inc.php.
References handleUpload().
| ArticleFileManager.uploadReviewFile | ( | $ | fileName, | |
| $ | fileId = null | |||
| ) |
Upload a file to the review file folder.
| $fileName | string the name of the file used in the POST form | |
| $fileId | int |
Definition at line 84 of file ArticleFileManager.inc.php.
References handleUpload().
| ArticleFileManager.uploadSubmissionFile | ( | $ | fileName, | |
| $ | fileId = null, |
|||
| $ | overwrite = false | |||
| ) |
Upload a submission file.
| $fileName | string the name of the file used in the POST form | |
| $fileId | int |
Definition at line 74 of file ArticleFileManager.inc.php.
References handleUpload().
| ArticleFileManager.uploadSubmissionNoteFile | ( | $ | fileName, | |
| $ | fileId = null, |
|||
| $ | overwrite = true | |||
| ) |
Upload a note file.
| $fileName | string the name of the file used in the POST form | |
| $fileId | int | |
| $overwrite | boolean |
Definition at line 148 of file ArticleFileManager.inc.php.
References handleUpload().
| ArticleFileManager.uploadSuppFile | ( | $ | fileName, | |
| $ | fileId = null, |
|||
| $ | overwrite = true | |||
| ) |
Upload a supp file.
| $fileName | string the name of the file used in the POST form | |
| $fileId | int | |
| $overwrite | boolean |
Definition at line 126 of file ArticleFileManager.inc.php.
References handleUpload().
Referenced by SuppFileForm.execute().
| ArticleFileManager.viewFile | ( | $ | fileId, | |
| $ | revision = null | |||
| ) |
View a file inline (variant of downloadFile).
Reimplemented from FileManager.
Definition at line 299 of file ArticleFileManager.inc.php.
References downloadFile().
| ArticleFileManager.writePublicFile | ( | $ | fileName, | |
| &$ | contents, | |||
| $ | mimeType, | |||
| $ | fileId = null, |
|||
| $ | overwrite = true | |||
| ) |
Write a public file.
| $fileName | string The original filename | |
| $contents | string The contents to be written to the file | |
| $mimeType | string The mime type of the original file | |
| $fileId | int | |
| $overwrite | boolean |
Definition at line 160 of file ArticleFileManager.inc.php.
References handleWrite().
| ArticleFileManager.writeSuppFile | ( | $ | fileName, | |
| &$ | contents, | |||
| $ | mimeType, | |||
| $ | fileId = null, |
|||
| $ | overwrite = true | |||
| ) |
Write a supplemental file.
| $fileName | string The original filename | |
| $contents | string The contents to be written to the file | |
| $mimeType | string The mime type of the original file | |
| $fileId | int | |
| $overwrite | boolean |
Definition at line 183 of file ArticleFileManager.inc.php.
References handleWrite().
1.5.6