feat: [REQ-008] Add CockpitServer on port 6051#14711
feat: [REQ-008] Add CockpitServer on port 6051#14711sonthien22501 wants to merge 3 commits intoJabRef:mainfrom
Conversation
|
Hey @sonthien22501! 👋 Thank you for contributing to JabRef! We have automated checks in place, based on which you will soon get feedback if any of them are failing. After all automated checks pass, a maintainer will also review your contribution. Once that happens, you can go through their comments in the "Files changed" tab and act on them, or reply to the conversation if you have further inputs. Please re-check our AI Usage Policy to ensure that your pull request is in line with it. It also contains links to our contribution guide in case of any other doubts related to our contribution workflow. |
|
Note that your PR will not be reviewed/accepted until you have gone through the mandatory checks in the description and marked each of them them exactly in the format of |
I mean: integrated there. Read the code there. Especially resources and GSon. |
|
Changes in this update:
|
|
Your code currently does not meet JabRef's code guidelines. IntelliJ auto format covers some cases. There seem to be issues with your code style and autoformat configuration. Please reformat your code (Ctrl+Alt+L) and commit, then push. In special cases, consider using |
koppor
left a comment
There was a problem hiding this comment.
Seems that the AI is not configured properly. Please guide it to follow AGENTS.md. Maybe, it need to be refined.
|
|
||
| private static final Logger LOGGER = LoggerFactory.getLogger(CockpitServer.class); | ||
| private static final int PORT = 6051; | ||
| private HttpServer server; |
| import org.slf4j.LoggerFactory; | ||
|
|
||
| /** | ||
| * It reads the JSON, checks the logic, and sends back JSON. |
There was a problem hiding this comment.
|
Following our discussion regarding the previous PR, I have decided to close it and delete that codebase to ensure I fully understand every line I commit. I want to align strictly with the project's quality standards. Current Progress: Instead of generating a new server implementation, I dug into the existing jabsrv module. I discovered that JabRef already has a robust HttpServerManager based on Grizzly. I have successfully: Located the existing server logic and identified why it wasn't starting (hidden preferences). Enabled the server locally (port 6051) and verified the connection from a browser using the existing REST endpoints. |
|
@sonthien22501 Nice. Its a learning path. No need to know everything right at the beginning. Its a journey. Aim is knowledge and experience growth. |
Summary
This PR implements the backend infrastructure for the "Researcher Cockpit" browser extension, satisfying REQ-008 (Bidirectional Communication).
It introduces a lightweight HTTP server (
CockpitServer) running inside JabRef that allows external browser plugins to communicate with the active JabRef instance.Technical Details
org.jabref.gui.remote.CockpitServer6051(Chosen to avoid conflict with JabRef's existing internal remote port 6050).GET /ping: Returns connectivity status.POST /check-existence: Accepts a JSON payload ({"url": "..."}) and currently returns a mocked response.How to Test
Researcher Cockpit Server started on port 6051.http://localhost:6051/ping.{"status": "connected", "message": "JabRef is listening!"}.Checklist
Closes _____
Steps to test
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)