pkp/pkp-lib — pull request #47 by MichaelThessel (2013-08-14 22:19:58+00:00)
Title: *8358* Disable genre selector for reviewer file attachment uploads

Bugzilla ticket: http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=8358

I had to analyze all the classes involved in file uploading to make sure I don't break anything. I will attach my notes here for safekeeping:

```
_SubmissionFileDAODelegate_

ArtworkFileDAODelegate extends SubmissionArtworkFileDAODelegate (final) - no genre

SubmissionArtworkFileDAODelegate extends SubmissionFileDAODelegate - no genre
ArticleFileDAODelegate extends SubmissionFileDAODelegate (final) - no genre

SubmissionFileDAODelegate extends DAO

* 3 references to genre (get/setters)
No rewrite required null handling is already implemented

DAO - no genre

_PKPFileDAO_

SubmissionFileDAO extends PKPSubmissionFileDAO (final)

* function getGenreCategoryMapping()
overwrites PKPSubmissionFileDAO::getGenreCategoryMapping
no rewrite required fall back to GENRE_CATEGORY_DOCUMENT

PKPSubmissionFileDAO extends PKPFileDAO

* function &insertObject(&$submissionFile, $sourceFile, $isUpload = false) {
utilizes: _castToGenre and _getFileImplementationForGenreId
no changes required (resolved by changing _getFileImplementationForGenreId)

* function &updateObject(&$updatedFile, $previousFileId = null, $previousRevision = null) {
utilizes: _castToGenre and _getFileImplementationForGenreId
calls: setGenreId getGenreId
no changes required (resolved by changing _getFileImplementationForGenreId)

* function &setAsLatestRevision($revisedFileId, $newFileId, $submissionId, $fileStage) {
used in ./lib/pkp/controllers/wizard/fileUpload/form/SubmissionFilesUploadConfirmationForm.inc.php
no rewrite required

* function newDataObjectByGenreId($genreId)
used in ./lib/pkp/classes/file/SubmissionFileManager.inc.php
no changes required (resolved by changing _getFileImplementationForGenreId)

* function getGenreCategoryMapping() {
placeholder to ensure that child class implements method
no rewrite required

* function &_getFileImplementationForGenreId($genreId) {
no external references
IMPLEMENTED fall back to GENRE_CATEGORY_DOCUMENT

* function &_getDaoDelegateForGenreId($genreId) {
no external references
no changes required (resolved by changing _getFileImplementationForGenreId)

* function &_castToGenre($submissionFile) {
no external references
no changes required (resolved by changing _getFileImplementationForGenreId)

ArticleFileDAO extends PKPFileDAO (final) - no genre
IssueFileDAO extends PKPFileDAO (final) - no genre

PKPFileDAO extends DAO - no genre
DAO - no genre

_PKPFile_

ArtworkFile extends ArticleFile - no genre
ArticleFile extends SubmissionFile

* function _generateFileName()
No rewrite required works with genreId null too

SubmissionFile extends PKPFile

* function setGenreId($genreId)
No rewrite required null values are already implemented
* function getGenreId()
No rewrite required null values are already implemented
* function _generateFileName()
genrates file name based on genre
No rewrite required works with genreId null too

PKPFile extends DataObject - no genre
DataObject - no genre
```