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

Rewrite code of CitaviImporter to avoid JAXBContext #9539

Open
koppor opened this issue Jan 6, 2023 · 11 comments
Open

Rewrite code of CitaviImporter to avoid JAXBContext #9539

koppor opened this issue Jan 6, 2023 · 11 comments
Assignees
Labels
📍 Assigned Assigned by assign-issue-action (or manually assigned) component: import-load dev: code-quality Issues related to code or architecture decisions

Comments

@koppor
Copy link
Member

koppor commented Jan 6, 2023

The code of org.jabref.logic.importer.fileformat.CitaviXmlImporter is written OK, but relies on JAXB. It should be rewritten using StAX-Parser and thus getting rid of a JAXB dependency.

The code reads like we do not hit polymorphism in XMLElements (which is not supported by JAXB. See FasterXML/jackson-modules-base#127).

See

for some code hints.

Similar to #9673, the gradle build target generateCitaviSource can be removed and the xsd file be removed from the source repository.

Hints

Example file

  1. Open 7Zip gui
  2. Open src/test/resources/org/jabref/logic/importer/fileformat/CitaviXmlImporterTest4.ctv6bak in 7zip.
  3. Open citavi-single.xml using 7 zip

Initial coding

  1. Remove gradle task generateCitaviSource
  2. Remove src/main/resources/xjc/citavi/citavi.xsd
  3. Exectue gradle clean task.
  4. Observe that CitaviXmlImporter does not compile
  5. Try to understand how MedlineImporter handles XML importing
  6. Work on fixing it. -> You have a) an example file (see above) and b) similar code (MedlineImporter )

Negleted Implementation Option

Thus, it seems to be "just" to include the dependency to jackson module jakarta-xmlbind and to use Jackson's XMLMapper. Code examples are at https://stackify.com/java-xml-jackson/.

@koppor koppor added dev: code-quality Issues related to code or architecture decisions component: import-load labels Jan 6, 2023
@koppor koppor changed the title Rewrite code of CitaviImporter to use Jackson Rewrite code of CitaviImporter to avoid JAXBContext Mar 18, 2023
@Siedlerchr Siedlerchr added the good first issue An issue intended for project-newcomers. Varies in difficulty. label May 18, 2023
@github-project-automation github-project-automation bot moved this to Free to take in Good First Issues May 18, 2023
@koppor koppor added this to the 5.11 milestone Sep 2, 2023
@koppor
Copy link
Member Author

koppor commented Sep 2, 2023

We should really work on that to get rid off buildSrc

@koppor
Copy link
Member Author

koppor commented Sep 2, 2023

Similar code refactoring: #9880

@ThiloteE ThiloteE added good first issue An issue intended for project-newcomers. Varies in difficulty. and removed good first issue An issue intended for project-newcomers. Varies in difficulty. labels Oct 9, 2023
@JoleneSun111
Copy link

Hello, I'm a new contributor, and I will carefully read the contribution guidelines. Could you please assign this issue to me? @koppor

@ThiloteE ThiloteE moved this from Free to take to Reserved in Candidates for University Projects Oct 11, 2023
@ThiloteE ThiloteE moved this from Free to take to Reserved in Good First Issues Oct 11, 2023
@koppor koppor modified the milestones: 5.11, v6.0 Oct 12, 2023
@koppor
Copy link
Member Author

koppor commented Oct 13, 2023

@JoleneSun111 If you want, you can also try https://github.com/FasterXML/StaxMate. However, that piece of library is not well documented. I would assume that basic Java Stax transformation is enough to solve the issue. - It is not straight-forward, but IMHO manageable nevertheless. The code is backed by tests, so there should be check if everything goes smoothely.

I remember we had the discussions that there have to build local data structures for the lookup of IDs.

@ShailikaS
Copy link

Hi @koppor, I would like to work on this if this issue is still open?

@ThiloteE
Copy link
Member

Since there has not been any activity here since the abandoned pull-request from AvunArasi (#9928), I will assign you @ShailikaS.

@ThiloteE ThiloteE assigned ShailikaS and unassigned JoleneSun111 Dec 28, 2023
@koppor
Copy link
Member Author

koppor commented Jan 22, 2024

@ShailikaS you have been assigned. Are you still working on this? -- It could be a bit hard to implement...

@koppor koppor moved this from Reserved to Free to take in Candidates for University Projects Apr 8, 2024
@koppor koppor moved this from Reserved to Free to take in Good First Issues Apr 8, 2024
@psyren99
Copy link

psyren99 commented Jul 4, 2024

like to take on this issue, if possible

@koppor koppor moved this from Free to take to Reserved in Candidates for University Projects Jul 9, 2024
@koppor koppor moved this from Free to take to Reserved in Good First Issues Jul 9, 2024
@koppor koppor added the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Jul 9, 2024
@koppor koppor mentioned this issue Aug 3, 2024
6 tasks
@JabRef JabRef deleted a comment from github-actions bot Oct 15, 2024
@koppor koppor moved this from Assigned to Free to take in Candidates for University Projects Oct 15, 2024
@koppor koppor moved this from Assigned to Free to take in Good First Issues Oct 15, 2024
@koppor koppor removed the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Oct 15, 2024
@koppor koppor removed the good first issue An issue intended for project-newcomers. Varies in difficulty. label Oct 18, 2024
@koppor
Copy link
Member Author

koppor commented Oct 18, 2024

Seems to be too hard for programming newcomers, therefore removed from "good first issues".

@koppor
Copy link
Member Author

koppor commented Oct 19, 2024

/assign @psyren99

Copy link
Contributor

👋 Hey @,

Thanks for your interest in this issue! 🎉

Newcomers, we're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly.

In case you encounter failing tests during development, please check our developer FAQs!

Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback.

⚠ Note that this issue will become unassigned if it isn't closed within ** days**.

🔧 A maintainer can also add the **** label to prevent it from being unassigned automatically.

Happy coding! 🚀

@github-actions github-actions bot added the 📍 Assigned Assigned by assign-issue-action (or manually assigned) label Oct 19, 2024
@koppor koppor moved this from Free to take to In Progress in Candidates for University Projects Oct 19, 2024
@Siedlerchr Siedlerchr removed this from the 6.0 milestone Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📍 Assigned Assigned by assign-issue-action (or manually assigned) component: import-load dev: code-quality Issues related to code or architecture decisions
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

6 participants