We are moving to Git Issues for bug tracking in future releases. During transition, content will be in both tools. If you'd like to file a new bug, please create an issue.

Bug 6127 - OMP clean-up: clean up file and file DAO class hierarchy.
OMP clean-up: clean up file and file DAO class hierarchy.
Product: OMP
Classification: Unclassified
Component: General
PC Linux
: P3 normal
Assigned To: PKP Support
Depends on:
Blocks: 6125
  Show dependency treegraph
Reported: 2010-11-03 17:10 PDT by jerico
Modified: 2011-09-06 14:38 PDT (History)
2 users (show)

See Also:
Version Reported In:
Also Affects:


Note You need to log in before you can comment on or make changes to this bug.
Description jerico 2010-11-03 17:10:00 PDT
There are some inconsistencies in the SubmissionFile class hierarchy.

1) MonographFile and ArtworkFile/MonographGalley inherit from SubmissionFile but their DAOs are separate from each other. I think it would be correct to have their DAOs also inherit from each other.

2) ArtworkFile is a specialization of Monograph file and therefore the database table artwork_monograph_file should have a 1:1 relation with monograph_file which is not the case, though. IMO an entry into artwork_monograph_file should also result in an entry into monograph_file. The DAO is not implemented like that, though. And uploading an artwork file does not seem to populate the fields required for a monograph file. IMO the artwork_id column should be removed and file_id should become the primary of artwork_monograph_file. Then ArtworkDAO should use functionality from MonographDAO to populate fields of it's superclasses (see #1 above).

3) Implementing a new table for every book file type category is not very scalable. We should be very sure that we only have to book file type categories (artwork and document) otherwise we'll soon have to implement further tables if we get files with different meta-data requirements. If that happens we better switch to an implementation that uses the _settings table for additional/differing meta-data.
Comment 1 Matthew Crider 2010-11-19 17:37:01 PST
4) Library Files are unecessary -- they can be subsumed by the existing monograph file infrastructure.
Comment 2 jerico 2010-11-19 18:43:50 PST
Matt, have you seen the additional comments I made about the file class hierarchy in our UML diagram? It's all just first ideas.
Comment 3 jerico 2010-11-21 20:36:12 PST
Refactoring and clean-up in monograph file handler: https://github.com/pkp/omp/commit/2645eeb17fa22d7f7e233b2fa0ca8d955273471c
Comment 4 jerico 2010-11-21 23:24:43 PST
Renaming monograph file type and publication format type IDs to conform with our database nomenclature, further refactored/simplified monograph file manager, moved file path generation for monographs from the monograph file manager to the monograph class to remove code duplication and inconsistency, coding style improvements, rename get/setMonographType() to ...Id() and change its column type from varchar to int, remove superfluous indexes that duplicate the primary key, see:
Comment 5 jerico 2010-11-27 11:53:25 PST
We should also abstract file access away from the actual file system implementation. This will allow us to base file access on any document repository we like, e.g. a system like Fedora or DuraSpace, a document management system, WebDav folders, etc.
Comment 8 jerico 2010-12-08 09:19:34 PST
And one more change (multiple delete statements rather than bulk delete):
Comment 9 Alec Smecher 2011-01-18 10:36:39 PST
See https://github.com/pkp/ojs/commit/16f21895b0811f50c460bb742daed0f69316d87d#commitcomment-244078 -- looks like a typo to me.
Comment 11 Alec Smecher 2011-09-06 14:38:51 PDT
Major overhaul items complete and the current structure is now baked in. Closing.