-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
When creating an entry based on a PDF, the file path should be relative #11173
Comments
Hi Oliver, Thanks for your reply on the mail. We are a group of 6 students from University of Adelaide, we would like to pursue this issue. Can you please assign this to me. Thanks, |
As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at. Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback. |
Hi Oliver, Thanks for the insight, although we will split the work between the team. We have to create report, presentations, test cases and prepare for demos in the course as well. We would surely be taking more issues if we are able to finish this off in time. Appreciate your insights and I'll get back to you as soon as possible with updates. |
Are you still pursuing this issue? |
On my machine with some custom configurations (which should be irrelevant here), using JabRef's development version (Windows 10), a relative file path looks like this, which differs from yours: I see that you have |
I believe this is a different issue from the one reported, we are working on the issue reported by Oliver, where the file path in the BibTex source is not relative. As per the fix that I have in my local, it is now storing the expected relative path in the BibTex Source. @koppor please let me know if my understanding is correct. |
On a second thought, @ThiloteE I believe the preferences that you have appears to be different from the one Oliver has provided. The ImportHandler class that we are working on for the issue reported by Oliver, does not seem to be handling the regular expressions in the preferences, it could be a different logic to handle the regex expressions in the preferences. |
@Arshadpd I see that the file path is relative.
|
Hi @koppor , Thanks for the pointers,
|
By the way, thank you for your efforts and motivation to work on this. Yes, my preferences are different from what Oliver provided, but it is still something that JabRef supports. If you provide a pull-request with the code, I can do some simple tests myself, such as moving my .bib library to a new location and importing it. Or you copy my preferences and do the tests on your fork, then you can rule out any syntax differences that stem from enabling "linked file name conventions". My intention is simply to check for breaking changes. The link to the video you provided does not work 🙅 |
Hi @ThiloteE , Sorry for the inconveniences, I'll add the video to my drive and share the link here. I'll be creating a pull request as soon as possible. Thanks for all the support. |
https://drive.google.com/file/d/1wG71ME3lfLlR_YcsrRy815onngvlgoyG/view?usp=sharing Thanks Oliver, I've already screen recorded the functionality in local. Please let me know if the above link is accessible and the thoughts on the video. |
@Arshadpd I see it. Now I am curious to the code. |
I am very sorry, that I did not explicitly link the documentation on "Directories for files" (https://docs.jabref.org/finding-sorting-and-cleaning-entries/filelinks#directories-for-files) in the issue description. I was sure that you would find it while checking how the other code works. I now also added code howtos for making a file path relative at https://devdocs.jabref.org/code-howtos/#get-a-relative-filename-or-path-for-a-file. Maybe, this helps. |
Hi @koppor , Apologies for a little delay on this, but I have resumed working on this, and I have taken the relativize method from "LinkedFilesHandler" class to reuse it in the "ImportHandler". I am attaching the screenshot for your reference, please let me know if this approach is right. |
Looks good 👍 Note that you can use Markdown to paste JavaCode. (Enclosed in three backticks) |
Hi Oliver, I am trying to write test cases for this code, just wanted to know, if there is any exiting method that I need to add logic to. I have looked in ImportHabndlerTest.java, but it does not have the code to test importFilesinBackground methods, existing logic. |
Hi @koppor , just wanted to follow up on the test case advise, can you please guide us on this, I have the code working and ready to be pushed. Please let us know what should be the next step if the existing code does not have test cases and is it possible to create the pull request without that. |
Hi @koppor We have attached the test cases document for your review. Looking forward to your feedback. |
Hello @koppor we have made an UML class diagram and report on the modification related with the solution of the issue. Can you please review and give us your feedback. |
Hi @koppor , We have sent another pull request, with the updated code that you approved earlier in the comments above. Please let us know your thoughts on the same. |
Test plan was very strange. No UI test mentioned. No evaluation of TestFX. |
Initial Setup and challenges that we faced |
Thank you! Seeing that you needed to learn git, it seems that this project was too large and required too much upfront knowledge. I checked our devdocs. We do say: Use Gradle in the IDE. However, there are two or three places where we refer to |
If you have time, you should try to add a test to |
It is good for a first version. I would try to be more precise. For instance, at "Impact of Changes", it reads "... thereby enhancing the user experience by making the |
When an entry is created using a PDF (by drag'n'drop on the main table - either at the free space or between two lines), the path of the linked PDF is stored as absolute path, but not relative. This needs to be fixed.
Implementation hint: There is functionality inside JabRef to make a path relative. It "just" needs to be found and wired correctly into that drop handling
Pre condition
Setting that files are stored relative to library file location.
Details
Example PDF: IST2015.pdf
Created BibTeX:
See that the content of
file
has an absolute path. That should be relative.Follow-up issue
The newly created entry is not added to the currently selected group. When working on this, please also try to fix this.
Other places where drag'n'drop works correctly
The text was updated successfully, but these errors were encountered: