Get latest version of Article Text

I need help to determine latest Article Text file using methods from SubmissionFileDAO.

I tried to use getLatestRevisions() method, but it’s not returning only latest Article Text, but any type of file.

If there is no method for this purpose, can you tell me how to determine only Article text files, using submission_files and associated tables in DB ?

Hi @Dragoljub_Djordjevic,

Can you please indicate which version you’re working in (e.g. 3.2.1)?

-Roger
PKP Team

Sorry, I forgot that. Version is 3.1.2

Hi @Dragoljub_Djordjevic,

The version of OJS that you’re using is no longer supported by PKP. I recommend that you upgrade to the newest version of OJS - I would recommend that you upgrade. However, other community members may wish to offer assistance.

Upgrading instructions are available in the PKP Administrator’s Guide.

-Roger
PKP Team

Thank you for your reply. We have some custom modifications, so we can’t upgrade easily.

I don’t need to use SubmissionFileDAO methods if you can tell me how to differ article text files from other files, I’ll make my own query and method.

Hi @Dragoljub_Djordjevic,

I don’t have access to a version of 3.1 that I can test, but when you go to upload a file you should have the option to select from options in “Article component” to differentiate between the Article text and other files: Chapter 13: Authoring
You can also do this in the production phase: Chapter 14: Editorial Workflow. And you can also edit the components for this vocabulary: Chapter 7: Workflow Settings.

-Roger
PKP Team

Maybe I wasn’t clear enough. I’m making some king of plugin, and need to get latest article text file for given submissionId. I can list all files for that submissionId in database, but I’m not sure which one is article text, and which are supplementary files.

My English is not very good, maybe I’m not explaining well.

Maybe @asmecher can help?

Hi @Dragoljub_Djordjevic,

OJS 3.1.2 is pretty old – but I believe you can find what you’re looking for by joining submission_files to genres on genre_id, then looking at the supplementary column of genres.

Regards,
Alec Smecher
Public Knowledge Project Team

2 Likes

Thanks @asmecher , right in the centre, as always :slight_smile:

Finally, I came up with this sollution:

select * from submission_files sf
                join genres g on sf.genre_id = g.genre_id
                where submission_id = :id and entry_key = 'SUBMISSION'
                order by file_stage desc;

I have to use ‘entry_key’ column, because in ‘supplementary’ column both submission and image has value of 0.

2 Likes

This topic was automatically closed after 10 days. New replies are no longer allowed.