pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
304 stars 444 forks source link

OJS API - add "originalFilename" as property for all dependent files #6288

Closed nils-stefan-weiher closed 1 year ago

nils-stefan-weiher commented 4 years ago

Describe the problem you would like to solve We want to use the OJS API to load metadata of an XML submission with dependent files, and to find the original reference of the dependent file in the XML we need the original filename, which is stored in the database but not visible in the API for dependent files of a submission galley.

In this line of the GalleyService.inc.php: https://github.com/pkp/ojs/blob/stable-3_2_1/classes/services/GalleyService.inc.php#L152

The "filename" property is set to the originalFilename but will be overwritten some lines later.

Describe the solution you'd like New property "originalFilename" that always returns the value of the original filename from the database.

Who is asking for this feature? Me and two other colleagues (developers) from University Library Heidelberg, which want to access submission data and files with external scripts for XML processing.

Additional information None

NateWr commented 3 years ago

Hi @isgrim, the submission files are undergoing a major refactor for 3.3. As part of that, we're dropping the originalFilename property altogether. Instead, the original filename will be used to set the initial name property. This is a multilingual property which can be updated in the UI, and will be used when downloading files (see description of new file download names).

In your use case, is the file's name (as it appears in editorial lists in OJS) likely to change between the XML submission and when you retrieve the metadata from the API? If not, then you should be able to do what you need without any further changes.

If it will change, then there won't be a reliable unique id for you to use to identify these files. The only place the original file name will be stored is in the activity log for that submission file.

nils-stefan-weiher commented 1 year ago

Closing this, because it is no longer an issue for us. If we properly set the name of the file we can identify it.