Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF and XML files imported as figure files #36

Open
joemull opened this issue Dec 14, 2021 · 2 comments
Open

PDF and XML files imported as figure files #36

joemull opened this issue Dec 14, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@joemull
Copy link
Member

joemull commented Dec 14, 2021

PDF and XML files are not recognized on import as editable files and so are imported as figure_data_files:

handle_file_import(row, article, zip_folder_path)

imports/utils.py

Lines 357 to 360 in e54b59a

if file.mime_type in files.EDITABLE_FORMAT:
article.manuscript_files.add(file)
else:
article.data_figure_files.add(file)

Seemingly as a result, they do not appear in the typesetting plugin in the place that they can be converted to galley files easily:
https://github.com/BirkbeckCTP/typesetting/blob/48720ad13775a640d5349e2f652288526f693422/templates/typesetting/elements/production_files.html#L20

As a quick fix, we can class these as manuscript files on import.

@joemull joemull added the bug Something isn't working label Dec 14, 2021
@joemull joemull self-assigned this Dec 14, 2021
@joemull joemull added this to v1.4.1 Dec 14, 2021
@joemull joemull moved this to Todo in v1.4.1 Dec 14, 2021
@joemull joemull removed this from v1.4.1 Dec 15, 2021
@joemull joemull removed their assignment Apr 29, 2024
@joemull
Copy link
Member Author

joemull commented Aug 29, 2024

This has now been effectively deprecated:

imports/utils.py

Lines 535 to 537 in a7451e3

# Turning off file imports to prep for overhaul
# if folder_path:
# handle_file_import(row, article, folder_path)

The importer now only allows PDFs:

imports/utils.py

Lines 400 to 407 in a7451e3

if (primary_row and primary_row.get("PDF URI")):
try:
import_galley_from_uri( article, primary_row["PDF URI"])
except Exception as e:
errors.append({
'article': primary_row.get('Article title'),
'error': f'Failed to import PDF: {e}',
})

@joemull
Copy link
Member Author

joemull commented Aug 29, 2024

The use case for importing a manuscript file would be: a journal has articles in progress during migration.

But this would likely not happen with more than 10 or so articles, so the benefit of writing an importer would not be felt, since that many can be done manually in not too much time.

So, what if we rethink this feature as a more generic file importer, where you can control what types of files are being imported--not just MS files but all kinds of files in Janeway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant