Skip to content

Conversation

@UserEstrella
Copy link
Contributor

@UserEstrella UserEstrella commented Nov 12, 2025

Closes #13588

Summary

This pull request implements the BibEntryResource as described in issue #13588.

Since the issue was created some time ago, several structural changes occurred in the project. Therefore, some of the initial instructions were no longer applicable, and adjustments were made accordingly.

Changes Made

  • Worked mainly within the jabsrv module.
  • Created a new file:
    jabref/jabsrv/src/main/java/org/jabref/http/server/resources/BibEntryResource.java
  • Moved all relevant methods from LibraryResource.java that contained the @PathParam("id") parameter — except the one annotated with @Path("entries/pdffiles") — into BibEntryResource.java.
  • Copied additional helper methods from LibraryResource that were required for these methods to work properly.
  • Updated the startServer() method in the Server class to include a reference to the new BibEntryResource.
  • Created a corresponding test class:
    jabref/jabsrv/src/test/java/org/jabref/http/server/BibEntryResourceTest.java,
    based on the existing LibraryResourceTest.java.

Steps to test

To verify the implementation:

  1. Start the GUI project (jabgui).
  2. Launch the server with:
    ./gradlew :jabsrv-cli:run
    

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • I manually tested my changes in running JabRef (always required)
  • I added JUnit tests for changes (if applicable)
  • [/] I added screenshots in the PR description (if change is visible to the user)
  • I described the change in CHANGELOG.md in a way that is understandable for the average user (if change is visible to the user)
  • [/] I checked the user documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.

@github-actions
Copy link
Contributor

Hey @UserEstrella!

Thank you for contributing to JabRef! Your help is truly appreciated ❤️.

We have automatic checks in place, based on which you will soon get automated feedback if any of them are failing. We also use TragBot with custom rules that scans your changes and provides some preliminary comments, before a maintainer takes a look. TragBot is still learning, and may not always be accurate. In the "Files changed" tab, you can go through its comments and just click on "Resolve conversation" if you are sure that it is incorrect, or comment on the conversation if you are doubtful.

Please re-check our contribution guide in case of any other doubts related to our contribution workflow.

@UserEstrella
Copy link
Contributor Author

Error BibEntryResource.java is not recognized in Server.java

@UserEstrella
Copy link
Contributor Author

JBang build not passing, don't recognize BibEntryResource, need to fix structure and retry

@Siedlerchr Siedlerchr reopened this Nov 18, 2025
@palukku
Copy link
Member

palukku commented Nov 18, 2025

JBang build not passing, don't recognize BibEntryResource, need to fix structure and retry

In order for jbang to work you need to add the class to the https://github.com/JabRef/jabref/blob/main/.jbang/JabSrvLauncher.java file as a source

Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also adapt jabsrv/src/test/rest-api.http and try out your new API.

Gson gson;

/**
* At http://localhost:23119/libraries/{id}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, this is comment wrong, we are at the BibEntry resource

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your feedback! Do you mean we should create a new specific end-point for the BibEntry resource? Something like this : <http://localhost:23119/librairies/demo/entries/{id}>?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope you already did.

Note: It already worked like this. The only issue was that the methods handling that were nested in the library class.

@github-actions github-actions bot added the status: changes-required Pull requests that are not yet complete label Nov 19, 2025
@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Nov 25, 2025
@koppor
Copy link
Member

koppor commented Nov 25, 2025

@UserEstrella Please link the in the first possiblity - ____ is not an issue numberr

grafik

Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, you misunderstood the whole concept of library collecting entries and a single entry.

Methods returning a complete library were moved. This is wrong...


I am a bit upset as your code makes the impression your just want to get the task done instead of learning something.

Example - JavaDoc format inconsitencies - why does the new class use two styles? - If it was in the old code - why not making it consistent?

grafik
grafik

The JavaDoc comment is for the library

@github-actions github-actions bot added the status: changes-required Pull requests that are not yet complete label Nov 25, 2025
@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Nov 26, 2025
@palukku palukku added the status: changes-required Pull requests that are not yet complete label Nov 26, 2025
@koppor
Copy link
Member

koppor commented Nov 26, 2025

I think, this whole task needs to be re-done and each step from the issue description followed.

The issue is NOT about adding new features, it is just about refactoring code.

@koppor koppor marked this pull request as draft November 26, 2025 11:35
@UserEstrella
Copy link
Contributor Author

I think, this whole task needs to be re-done and each step from the issue description followed.

The issue is NOT about adding new features, it is just about refactoring code.

Hi, thank you for your feedback.

We tried to follow each step from the issue description. However, during the refactoring we encountered a difficulty:
in our version of LibraryResource, the method getPlainRepresentation (mentioned in the issue example) was not present, and we could not find any method annotated with @path("entries/{entryId}").

Because these elements were missing, we attempted an adaptation based on the available methods and the parameters that were being passed, but it is now clear that this was not the correct approach.

We would appreciate any clarification on where the expected @path("entries/{entryId}") methods are located in the current codebase, or whether they were removed/renamed, so that we can redo the task properly according to the issue requirements.

Thanks again for your guidance.

@koppor
Copy link
Member

koppor commented Nov 28, 2025

We tried to follow each step from the issue description. However, during the refactoring we encountered a difficulty: in our version of LibraryResource, the method getPlainRepresentation (mentioned in the issue example) was not present, and we could not find any method annotated with @path("entries/{entryId}").

Thank you for the close look - it was removed 2 months ago: 968d289 - and added to EntryResource.

I found it with using Ctrl+Shift+F and searching for entries/{entryId}. This is called "fulltext search".

I think, there is nothing left to be done. Please check another issue.

Sorry for any inconvenience caused.

@koppor koppor closed this Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first contrib status: changes-required Pull requests that are not yet complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create BibEntryResource

5 participants